Disclaimer: The purpose of the Open Case Studies project is to demonstrate the use of various data science methods, tools, and software in the context of messy, real-world data. A given case study does not cover all aspects of the research process, is not claiming to be the most appropriate way to analyze a given dataset, and should not be used in the context of making policy decisions without external consultation from scientific experts.

Motivation

An article was recently published in the lancet journal that evaluates global dietary trends and the relationship of these dietary factors with mortality and fertility.

GBD 2017 Diet Collaborators. Health effects of dietary risks in 195 countries, 1990–2017: a systematic analysis for the Global Burden of Disease Study 2017. The Lancet 393, 1958–1972 (2019).

This article evaluated food consumption patterns in 195 countries for 15 different dietary risk factors that have probable associations with non-communicable disease (NCD). For example, overconsumption of sodium is associated with high blood pressure. These consumption levels were then used to estimate levels of mortality and morbidity due NCD, as well as disability-adjusted life-years (DALYs) attributible to suboptimal consumption of foods related to these dietary risk factors. The authors found that:

“High intake of sodium …, low intake of whole grains …, and low intake of fruits … were the leading dietary risk factors for deaths and DALYs globally and in many countries.”

This figure from the supplement shows the ranking of the 15 dietary risk factors based on the estimated number of attributable deaths and illustartes how the top 3 risk factors are often issues for many different countries.

This case study will evaluate the data reported in this article to explore regional, age, and gender specific differences in dietary consumption patterns around the world in 2017.

Main Questions

Our main questions are:

  1. What are the global trends for potentially harmful diets?
  2. How do males and females compare?
  3. How do different age groups compare for these dietary factors?
  4. How do different countries compare? In particular, how does the US compare to other contries in terms of diet trends?

Learning Objectives

In this case study, we’ll walk you through importing data from a pdf, cleaning data, wrangling data, joining data, visualizing the data, and comparing two or more groups using well-established and commonly used packages, including stringr, tidyr, dplyr, purrr, and ggplot2. We will especially focus on using packages and functions from the Tidyverse. The Tidyverse is a library of packages created by the chief scientist at RStudio, Hadley Wickham. While some students may be familiar with previous R programming packages, these packages make data science in R especially efficient.

We will begin by loading the packages that we will need:

Package Use
here to easily load and save data
readr to import the csv file data
dplyr to arrange/filter/select/compare specific subsets of the data
skimr to get an overview of data
pdftools to read a pdf into R
stringr to manipulate the text within the pdf of the data
magrittr to use the %<>% pipping operator
purrr to perform functions on all columns of a tibble
tibble to create data objects that we can manipulate with dplyr/stringr/tidyr/purrr
tidyr to separate data within a column into multiple columns
ggplot2 to make visualizations with multiple layers
ggpubr to easily add regression line equations to plots
forcats to change details about factors (categorical variables)
ggrepel to allow labels in figures not to overlap
cowplot to allow plots to be combined

glue | to paste or combine character strings and data together

The first time we use a function, we will use the :: to indicate which package we are using. Unless we have overlapping function names, this is not necessary, but we will include it here to be informative about where the functions we will use come from.

Context

Here is an excerpt from the article itself about the context of the work:

Many dietary factors have well-estabished associations with health risk. The authors that generated this dataset identified 15 dietary factors that have probably health risk based on literature search.

Here you can see a table of the sources for the health risks associated with the dietary factors. RCT stands for randomized control trials.

In the article the authors found that most of the mortality associated with each factor is related to cardiovascular disease.

Limitations

There are some important limitations regarding the data from this article to keep in mind. The definition of certain dietary factors varied across some of the collection sources. Intakes of certain healthy foods like vegitables and fruits are likely positively correlated and likely negatively correlated with intakes of unhealthy foods. Much of the data was collected with 24 hour recall surveys which are prone to issues due to inaccuracy of memory recall or other biases such as a tendency for some people to report healthier behaviriors. The guidelines in the table are based are not parsed by gender even though it is known that there are different dietary requirements for optimal health for certain nutrients. The article discusses some limitations about accounting for overall food consumption when calculting consumption of particular foods:

"To remove the effect of energy intake as a potential confounder and address measurement error in dietary assessment tools, most cohorts have adjusted for total energy intake in their statistical models. This energy adjustment means that diet components are defined as risks in terms of the share of diet and not as absolute levels of exposure. In other words, an increase in intake of foods and macronutrients should be compensated by a decrease in intake of other dietary factors to hold total energy intake constant. Thus, the relative risk of change in each component of diet depends on the other components for which it is substituted. However, the relative risks estimated from meta-analyses of cohort studies do not generally specify the type of substitution.

There are also important nuances to keep in mind regrading some of the dietary factors. For example calcium consumption was calculated based on consumption of dairy products, however calcium can be aquired from other sources including plant-based sources. However in these data, the influence of plant-based consumption of calcium was also not accounted for, nor was supplementation through vitamin sources.

What are the data?

We will be using data that we requested from the GBD about dietary intake, as well as the guideline data about optimal consumption amounts for different foods contained within the PDF of the article. We have two csv files. The first one includes consumption levels at the global level and for different countries for all ages combined.

Looking at the csv file in excel:

Here you can see that the data contains mean consumption values for both men and women in various countries at the national level in 2017 for various foods that may be problematic for health. The units for the food varies. So for example, the mean column in row that says “Diet low in fiber” indicates the average consumption level per person in that region and of that gender of fiber in grams per day.

The second csv file has similar data, but consumption levels for different age groups are separated.

The authors of this article obtained the data from a variety of sources including household budjet surveys and nutritional surveys regarding 24 hour recall of food consumption and 24 hour unrinary sodium analysis. The ata was derived from sales data from Euromonitor, data from the United Nations Food and Agriculture Organization (FAO), estimates about national availability of specific nutrients, from the Supply Utilazation Accounts(SUA), and the United States Department of Agriculture’s National Nutrition Database.

Note: While gender and sex are not actually binary, the data presented that is used in this analysis only contains data for groups of individuals described as men or women.

Data Import

Let’s import our data into R now so that we can explore the data further.

First let’s just get a general sense of our data. We can do that using the glimpse() function of the dplyr package (it is also in the tibble package).

Observations: 5,880
Variables: 11
$ year_id        <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2…
$ location_name  <chr> "Global", "Global", "Global", "Global", "Global",…
$ rei_id         <dbl> 111, 111, 112, 112, 113, 113, 114, 114, 115, 115,…
$ rei_name       <chr> "Diet low in fruits", "Diet low in fruits", "Diet…
$ age_group_name <chr> "All Available Ages", "All Available Ages", "All …
$ sex            <chr> "Male", "Female", "Male", "Female", "Male", "Fema…
$ parameter      <chr> "continuous", "continuous", "continuous", "contin…
$ mean           <dbl> 8.703202e+01, 9.953182e+01, 1.975187e+02, 1.83233…
$ upper          <dbl> 8.988734e+01, 1.023450e+02, 2.083679e+02, 1.92110…
$ lower          <dbl> 8.452347e+01, 9.672140e+01, 1.887154e+02, 1.75401…
$ unit           <chr> "g/day", "g/day", "g/day", "g/day", "g/day", "g/d…
Observations: 88,200
Variables: 11
$ year_id        <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2…
$ location_name  <chr> "Global", "Global", "Global", "Global", "Global",…
$ rei_name       <chr> "Diet low in fruits", "Diet low in fruits", "Diet…
$ age_group_id   <dbl> 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 3…
$ age_group_name <chr> "25 to 29", "30 to 34", "35 to 39", "40 to 44", "…
$ sex            <chr> "Male", "Male", "Male", "Male", "Male", "Male", "…
$ parameter      <chr> "continuous", "continuous", "continuous", "contin…
$ mean           <dbl> 68.54567, 72.62209, 76.73157, 81.03910, 88.79202,…
$ upper          <dbl> 75.16806, 80.00433, 84.73205, 89.52747, 100.94301…
$ lower          <dbl> 63.17081, 66.78018, 71.04691, 73.82734, 80.40971,…
$ unit           <chr> "g/day", "g/day", "g/day", "g/day", "g/day", "g/d…

Here we can tell that the sep_age_diet_data is much larger than the diet_data. There are 88,200 rows! The diet_data has only 5,880 rows. However, both files appear to have the same column structure with 11 variables each.

The skim() function of the skimr package is also really helpful for getting a general sense of your data.

Data summary
Name diet_data
Number of rows 5880
Number of columns 11
_______________________
Column type frequency:
character 6
numeric 5
________________________
Group variables None

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
location_name 0 1 4 32 0 196 0
rei_name 0 1 16 39 0 15 0
age_group_name 0 1 18 18 0 1 0
sex 0 1 4 6 0 2 0
parameter 0 1 10 10 0 1 0
unit 0 1 5 11 0 2 0

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
year_id 0 1 2017.00 0.00 2017 2017.00 2017.00 2017.00 2017.00 ▁▁▇▁▁
rei_id 0 1 133.67 53.93 111 114.00 118.00 123.00 333.00 ▇▁▁▁▁
mean 0 1 34.81 60.13 0 0.45 8.38 42.66 566.69 ▇▁▁▁▁
upper 0 1 37.94 65.30 0 0.49 9.22 46.54 624.23 ▇▁▁▁▁
lower 0 1 31.93 55.40 0 0.42 7.52 39.21 513.22 ▇▁▁▁▁

Notice how there is a column about the values that are missing. It looks like our data is very complete and we do not have any missing data. We also get a sense about the size of our data.

The n_unqiue column shows us the number of unqiue values for each of our columns.

Let’s take a look at sep_age_diet_data.

Data summary
Name sep_age_diet_data
Number of rows 88200
Number of columns 11
_______________________
Column type frequency:
character 6
numeric 5
________________________
Group variables None

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
location_name 0 1 4 32 0 196 0
rei_name 0 1 16 39 0 15 0
age_group_name 0 1 7 8 0 15 0
sex 0 1 4 6 0 2 0
parameter 0 1 10 10 0 1 0
unit 0 1 5 11 0 2 0

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
year_id 0 1 2017.00 0.00 2017 2017.00 2017.00 2017.00 2017.00 ▁▁▇▁▁
age_group_id 0 1 32.87 54.46 10 13.00 17.00 30.00 235.00 ▇▁▁▁▁
mean 0 1 39.84 63.86 0 0.56 10.80 52.63 604.01 ▇▁▁▁▁
upper 0 1 48.07 78.38 0 0.70 13.55 59.96 806.98 ▇▁▁▁▁
lower 0 1 33.46 54.54 0 0.42 8.46 44.87 639.06 ▇▁▁▁▁

We can see that there are many more rows in this dataset.

Let’s take a look at the different dietary risk factors considered. To do this we will use the distinct() function of the dplyr package.

This function grabs only the distinct or unique rows from a given variable (rei_name, in our case) of a given data frame (diet_data, in our case).

# A tibble: 15 x 1
   rei_name                               
   <chr>                                  
 1 Diet low in fruits                     
 2 Diet low in vegetables                 
 3 Diet low in whole grains               
 4 Diet low in nuts and seeds             
 5 Diet low in milk                       
 6 Diet high in red meat                  
 7 Diet high in processed meat            
 8 Diet high in sugar-sweetened beverages 
 9 Diet low in fiber                      
10 Diet low in seafood omega-3 fatty acids
11 Diet low in polyunsaturated fatty acids
12 Diet high in trans fatty acids         
13 Diet high in sodium                    
14 Diet low in calcium                    
15 Diet low in legumes                    

We will be using the %>% pipe for sequential steps in our code later on. This will make more sense when we have multiple sequential steps using the same data object.

We could do the same code as above using this notation. For example we first grab the diet_data, then we select the distinct values of the rei_name variable.

# A tibble: 15 x 1
   rei_name                               
   <chr>                                  
 1 Diet low in fruits                     
 2 Diet low in vegetables                 
 3 Diet low in whole grains               
 4 Diet low in nuts and seeds             
 5 Diet low in milk                       
 6 Diet high in red meat                  
 7 Diet high in processed meat            
 8 Diet high in sugar-sweetened beverages 
 9 Diet low in fiber                      
10 Diet low in seafood omega-3 fatty acids
11 Diet low in polyunsaturated fatty acids
12 Diet high in trans fatty acids         
13 Diet high in sodium                    
14 Diet low in calcium                    
15 Diet low in legumes                    

Ok, so that gives us an idea of what dietary factors we can explore.

Let’s see if the location_name values are the same between both csv files. To do this we will use the setequal() function of dplyr.

[1] TRUE

Ok, we got the value of TRUE, so it looks like the same locations are in both files.

Note: In this case were comparing two different objects so using the pipe is not as useful.

Let’s take a look at the locations included in the data.

  [1] "Global"                           "China"                           
  [3] "North Korea"                      "Taiwan"                          
  [5] "Cambodia"                         "Indonesia"                       
  [7] "Laos"                             "Malaysia"                        
  [9] "Maldives"                         "Myanmar"                         
 [11] "Philippines"                      "Sri Lanka"                       
 [13] "Thailand"                         "Timor-Leste"                     
 [15] "Vietnam"                          "Fiji"                            
 [17] "Kiribati"                         "Marshall Islands"                
 [19] "Federated States of Micronesia"   "Papua New Guinea"                
 [21] "Samoa"                            "Solomon Islands"                 
 [23] "Tonga"                            "Vanuatu"                         
 [25] "Armenia"                          "Azerbaijan"                      
 [27] "Georgia"                          "Kazakhstan"                      
 [29] "Kyrgyzstan"                       "Mongolia"                        
 [31] "Tajikistan"                       "Turkmenistan"                    
 [33] "Uzbekistan"                       "Albania"                         
 [35] "Bosnia and Herzegovina"           "Bulgaria"                        
 [37] "Croatia"                          "Czech Republic"                  
 [39] "Hungary"                          "Macedonia"                       
 [41] "Montenegro"                       "Poland"                          
 [43] "Romania"                          "Serbia"                          
 [45] "Slovakia"                         "Slovenia"                        
 [47] "Belarus"                          "Estonia"                         
 [49] "Latvia"                           "Lithuania"                       
 [51] "Moldova"                          "Russian Federation"              
 [53] "Ukraine"                          "Brunei"                          
 [55] "Japan"                            "South Korea"                     
 [57] "Singapore"                        "Australia"                       
 [59] "New Zealand"                      "Andorra"                         
 [61] "Austria"                          "Belgium"                         
 [63] "Cyprus"                           "Denmark"                         
 [65] "Finland"                          "France"                          
 [67] "Germany"                          "Greece"                          
 [69] "Iceland"                          "Ireland"                         
 [71] "Israel"                           "Italy"                           
 [73] "Luxembourg"                       "Malta"                           
 [75] "Netherlands"                      "Norway"                          
 [77] "Portugal"                         "Spain"                           
 [79] "Sweden"                           "Switzerland"                     
 [81] "United Kingdom"                   "Argentina"                       
 [83] "Chile"                            "Uruguay"                         
 [85] "Canada"                           "United States"                   
 [87] "Antigua and Barbuda"              "The Bahamas"                     
 [89] "Barbados"                         "Belize"                          
 [91] "Cuba"                             "Dominica"                        
 [93] "Dominican Republic"               "Grenada"                         
 [95] "Guyana"                           "Haiti"                           
 [97] "Jamaica"                          "Saint Lucia"                     
 [99] "Saint Vincent and the Grenadines" "Suriname"                        
[101] "Trinidad and Tobago"              "Bolivia"                         
[103] "Ecuador"                          "Peru"                            
[105] "Colombia"                         "Costa Rica"                      
[107] "El Salvador"                      "Guatemala"                       
[109] "Honduras"                         "Mexico"                          
[111] "Nicaragua"                        "Panama"                          
[113] "Venezuela"                        "Brazil"                          
[115] "Paraguay"                         "Algeria"                         
[117] "Bahrain"                          "Egypt"                           
[119] "Iran"                             "Iraq"                            
[121] "Jordan"                           "Kuwait"                          
[123] "Lebanon"                          "Libya"                           
[125] "Morocco"                          "Palestine"                       
[127] "Oman"                             "Qatar"                           
[129] "Saudi Arabia"                     "Syria"                           
[131] "Tunisia"                          "Turkey"                          
[133] "United Arab Emirates"             "Yemen"                           
[135] "Afghanistan"                      "Bangladesh"                      
[137] "Bhutan"                           "India"                           
[139] "Nepal"                            "Pakistan"                        
[141] "Angola"                           "Central African Republic"        
[143] "Congo"                            "Democratic Republic of the Congo"
[145] "Equatorial Guinea"                "Gabon"                           
[147] "Burundi"                          "Comoros"                         
[149] "Djibouti"                         "Eritrea"                         
[151] "Ethiopia"                         "Kenya"                           
[153] "Madagascar"                       "Malawi"                          
[155] "Mauritius"                        "Mozambique"                      
[157] "Rwanda"                           "Seychelles"                      
[159] "Somalia"                          "Tanzania"                        
[161] "Uganda"                           "Zambia"                          
[163] "Botswana"                         "Lesotho"                         
[165] "Namibia"                          "South Africa"                    
[167] "Swaziland"                        "Zimbabwe"                        
[169] "Benin"                            "Burkina Faso"                    
[171] "Cameroon"                         "Cape Verde"                      
[173] "Chad"                             "Cote d'Ivoire"                   
[175] "The Gambia"                       "Ghana"                           
[177] "Guinea"                           "Guinea-Bissau"                   
[179] "Liberia"                          "Mali"                            
[181] "Mauritania"                       "Niger"                           
[183] "Nigeria"                          "Sao Tome and Principe"           
[185] "Senegal"                          "Sierra Leone"                    
[187] "Togo"                             "American Samoa"                  
[189] "Bermuda"                          "Greenland"                       
[191] "Guam"                             "Northern Mariana Islands"        
[193] "Puerto Rico"                      "Virgin Islands, U.S."            
[195] "South Sudan"                      "Sudan"                           

OK, so there are global values, as well as values for 185 countries.

Let’s take a look at the data when we order it by the mean consumption rate column:

Observations: 5,880
Variables: 11
$ year_id        <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2…
$ location_name  <chr> "Lebanon", "Lebanon", "Italy", "Turkey", "Kazakhs…
$ rei_id         <dbl> 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,…
$ rei_name       <chr> "Diet high in trans fatty acids", "Diet high in t…
$ age_group_name <chr> "All Available Ages", "All Available Ages", "All …
$ sex            <chr> "Male", "Female", "Male", "Male", "Male", "Male",…
$ parameter      <chr> "continuous", "continuous", "continuous", "contin…
$ mean           <dbl> 0.000727793, 0.000819837, 0.001357473, 0.00141107…
$ upper          <dbl> 0.000892791, 0.001007998, 0.001491509, 0.00172748…
$ lower          <dbl> 0.000585340, 0.000670438, 0.001233583, 0.00113497…
$ unit           <chr> "%energy/day", "%energy/day", "%energy/day", "%en…

Ok, so it looks like people in Lebanon dont eat very many trans fatty acids.

Let’s also figure out how many values there are in each age group of the data that is separated by age.

# A tibble: 15 x 2
   age_group_name     n
   <chr>          <int>
 1 25 to 29        5880
 2 30 to 34        5880
 3 35 to 39        5880
 4 40 to 44        5880
 5 45 to 49        5880
 6 50 to 54        5880
 7 55 to 59        5880
 8 60 to 64        5880
 9 65 to 69        5880
10 70 to 74        5880
11 75 to 79        5880
12 80 to 84        5880
13 85 to 89        5880
14 90 to 94        5880
15 95 plus         5880

That’s a lot of values!

Let’s look a bit deeper to try to understand why. We can use the count function again but get the number of values for each category within sex, age_group_name and location_name of the data.

# A tibble: 5,880 x 4
   sex    age_group_name location_name           n
   <chr>  <chr>          <chr>               <int>
 1 Female 25 to 29       Afghanistan            15
 2 Female 25 to 29       Albania                15
 3 Female 25 to 29       Algeria                15
 4 Female 25 to 29       American Samoa         15
 5 Female 25 to 29       Andorra                15
 6 Female 25 to 29       Angola                 15
 7 Female 25 to 29       Antigua and Barbuda    15
 8 Female 25 to 29       Argentina              15
 9 Female 25 to 29       Armenia                15
10 Female 25 to 29       Australia              15
# … with 5,870 more rows

Ok, so it looks like there are probably the consumption values for each of the different dietary factors(which there were 15 different factors) for each age group, for each gender, and for each country.

We can confirm this by filtering the data to one of the age groups, for a single gender, and for a single location.

# A tibble: 15 x 11
   year_id location_name rei_name age_group_id age_group_name sex  
     <dbl> <chr>         <chr>           <dbl> <chr>          <chr>
 1    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
 2    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
 3    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
 4    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
 5    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
 6    2017 Afghanistan   Diet hi…           10 25 to 29       Fema…
 7    2017 Afghanistan   Diet hi…           10 25 to 29       Fema…
 8    2017 Afghanistan   Diet hi…           10 25 to 29       Fema…
 9    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
10    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
11    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
12    2017 Afghanistan   Diet hi…           10 25 to 29       Fema…
13    2017 Afghanistan   Diet hi…           10 25 to 29       Fema…
14    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
15    2017 Afghanistan   Diet lo…           10 25 to 29       Fema…
# … with 5 more variables: parameter <chr>, mean <dbl>, upper <dbl>,
#   lower <dbl>, unit <chr>

Let’s also get the data from the PDF of the paper so that we can calculate consumption of these dietary factors as percentage of daily requirement, which would be more interpretable.

We are interested in this table on page 3:

First let’s import the PDF using the pdftools package.

We can use the base summary() function to get a sense of what the data looks like. By base we mean that these functions are part of the base package and are loaded automatically.Thus library(base) is not required.

   Length     Class      Mode 
       15 character character 

We can see that we have 15 different character strings. Each one contains the text on each of the 15 different pages of the PDF.

Data Wrangling

Again, the table we are interested in is on the third page, so let’s grab just that portion of the PDF.

   Length     Class      Mode 
        1 character character 
 chr "                                                                                                                                                                                                    Articles\nin systolic blood pressure, and then estimated the                                           Disease-specific deaths and disability-adjusted\nrelationship between change in systolic blood pressure                                       life-years\nand disease outcomes.14                                                                      Data on disease-specific deaths and disability-adjusted\n                                                                                             life-years (DALYs) by age, sex, country, and year were\nOptimal level of intake        "| __truncated__

Here we can see that the table object now contains the text from the 3rd page as a single large character string. However the text is difficult to read beacuse of the column structure in the pdf. Now let’s try to grab just the text in the table.

One way to approach this is to split the string by some pattern that we notice in the table.

Only the capitalized form of the word “Diet” apears to be within the table, and is not present in the preceding text (altough “diet” is). All the rows of interest of the table appear to start with the word “Diet”.

Let’s use the str_split() function of the stringr package to split the data within the object called tableby the word “Diet”. Only lines from page 3 that contain the word Diet will be selected (and not “diet” as this function is case-sensitive). Each section of the text that contians “Diet” will be split into individual pieces everytime the world “Diet” occurs and the word itself will be removed.

In this case we are also using the magrittr assignment pipe or double pipe that looks like this %<>%. This allows us use the table data as input to the later steps but also reassign the output to the same data object name.

Using the base::summary() and dplyr::glimpse() function we can see that we created a list of the rows in the table that contain the word “Diet”. We can see that we start with the row that contains “Diet low in fruits”.

     Length Class  Mode     
[1,] 17     -none- character
List of 1
 $ : chr [1:17] "                                                                                                               "| __truncated__ " low in fruits                  Mean daily consumption of fruits (fresh, frozen, cooked, canned, or dried fruit"| __truncated__ " low in vegetables              Mean daily consumption of vegetables (fresh, frozen, cooked, canned, or dried v"| __truncated__ " low in legumes                 Mean daily consumption of legumes (fresh, frozen, cooked, canned, or dried legu"| __truncated__ ...

RStudio creates really cheatsheets like this one which shows you all the major functions in stringr. You can download others here.

You can see that we could have also used the str_split_fixed() function which would also separate the substrings into different columns of a matrix, however we would need to know the number of substrings or pieces that we would like returned.

For more information about str_split() see here.

Let’s separte the values within the list using the base unlist function, this will allow us to easily select the different substrings within the object called table.

It’s important to realize that the first split will split the text before the first occurance of Data as the first value in the output. We could use the first() function of the dplyr package to look at this value. However, we will suppress the output as this is quite large.

Instead we can take a look at the second element of the list. using the nth() function of dplyr.

[1] " low in fruits                  Mean daily consumption of fruits (fresh, frozen, cooked, canned, or dried fruits, excluding              250 g (200–300) per day                           94·9\n                                       fruit juices and salted or pickled fruits)\n   "

Indeed this looks like the first row of interest in our table:

Using the last() and the nth() functions of the dplyr package we can take a look at the last values of the list.

[1] " high in sodium                 24 h urinary sodium measured in g per day                                                                   3 g (1–5) per day*                             26·2\n  *To reflect the uncertainty in existing evidence on optimal level of intake for sodium, 1–5 g per day was considered as the uncertainty range for the optimal level of sodium where less than 2·3 g per day is the\n  intake level of sodium associated with the lowest level of blood pressure in randomised controlled trials and 4–5 g per day is the level of sodium intake associated with the lowest risk of cardiovascular disease in\n  observational studies.\n  Table: "
[1] "ary risk factor exposure definitions, optimal level, and data representativeness index, 1990–2017\nwww.thelancet.com Published online April 3, 2019 http://dx.doi.org/10.1016/S0140-6736(19)30041-8                                                                                                                         3\n"

Therefore, we dont need this part of the table or the text before the table if we just want the consumption reccomendations.

So we will select the 2nd through the second to last of the substrings. Since we have 17 substrings, we will select the 2nd through the 16th. However a better way to do this rather than selecting by index, would be to select phrases that are unique to the text within the table that we want. We will use the str_subset() function of stringr package to select the table rows with consumption guidlines. Most of the rows have the phrase" Mean daily consumption“, however, there are other phrases for some of the rows, including”Mean daily intake" and “24 h sodium”

Notice that we speparate the different patterns to look for using vertical bar character “|” and that all of the patterns are within quotation marks together.

Question opportunity:

  1. What other string patterns could you use to subset the rows of the table that we want?

  2. Why might it be better to subset based on the text rather than the index?

Now the first row is what we want:

[1] " low in fruits                  Mean daily consumption of fruits (fresh, frozen, cooked, canned, or dried fruits, excluding              250 g (200–300) per day                           94·9\n                                       fruit juices and salted or pickled fruits)\n   "

And the last row is what we want:

[1] " high in sodium                 24 h urinary sodium measured in g per day                                                                   3 g (1–5) per day*                             26·2\n  *To reflect the uncertainty in existing evidence on optimal level of intake for sodium, 1–5 g per day was considered as the uncertainty range for the optimal level of sodium where less than 2·3 g per day is the\n  intake level of sodium associated with the lowest level of blood pressure in randomised controlled trials and 4–5 g per day is the level of sodium intake associated with the lowest risk of cardiovascular disease in\n  observational studies.\n  Table: "

Notice that there the decimal points from the pdf are being recognized as an interpunct instead of a period or decimal. An interpunct is a centered dot, as opposed to a period or decimal that is aligned to the bottom of the line.

The interpunct was previously used to separate words in certain languages, like ancient Latin.

[source]

You can produce an interpunct on a mac like this:

[source]

It is important to replace these for later when we want these values to be converted from character strings to numeric. We will again use the stringr package. This time we will use the str_replace_all() function which replaces all instances of a pattern in an individual string. In this case we want to replace all instances of the interpunct with a decimal point.

Now we will try to split the strings for each row based on the presence of 2 spaces to create the columns of the table, as there appears to be larger than a space between the columns to create substrings. The substrings will be separated by quotes.

The second page of the stringr cheetsheet has more information about using “Special Characters” in stringr. For example \\s is interpreted as a space as the \\ indicates that the s should be interpreted as a special character and not simply the letter s. The {2,} indicates 2 or more spaces, while {2} would indicate exactly 2 spaces.

List of 15
 $ : chr [1:6] " low in fruits" "Mean daily consumption of fruits (fresh, frozen, cooked, canned, or dried fruits, excluding" "250 g (200–300) per day" "94.9" ...
 $ : chr [1:7] " low in vegetables" "Mean daily consumption of vegetables (fresh, frozen, cooked, canned, or dried vegetables," "360 g (290–430) per day" "94.9" ...
 $ : chr [1:5] " low in legumes" "Mean daily consumption of legumes (fresh, frozen, cooked, canned, or dried legumes)" "60 g (50–70) per day" "94.9" ...
 $ : chr [1:7] " low in whole grains" "Mean daily consumption of whole grains (bran, germ, and endosperm in their natural" "125 g (100–150) per day" "94.9" ...
 $ : chr [1:5] " low in nuts and seeds" "Mean daily consumption of nut and seed foods" "21 g (16–25) per day" "94.9" ...
 $ : chr [1:6] " low in milk" "Mean daily consumption of milk including non-fat, low-fat, and full-fat milk, excluding soy" "435 g (350–520) per day" "94.9" ...
 $ : chr [1:6] " high in red meat" "Mean daily consumption of red meat (beef, pork, lamb, and goat, but excluding poultry, fish," "23 g (18–27) per day" "94.9" ...
 $ : chr [1:6] " high in processed meat" "Mean daily consumption of meat preserved by smoking, curing, salting, or addition of" "2 g (0–4) per day" "36.9" ...
 $ : chr [1:6] " high in sugar-sweetened Mean daily consumption of beverages with ≥50 kcal per 226.8 serving, including carbonated" "3 g (0–5) per day" "36.9" "beverages" ...
 $ : chr [1:6] " low in fibre" "Mean daily intake of fibre from all sources including fruits, vegetables, grains, legumes, and" "24 g (19–28) per day" "94.9" ...
 $ : chr [1:5] " low in calcium" "Mean daily intake of calcium from all sources, including milk, yogurt, and cheese" "1.25 g (1.00–1.50) per day" "94.9" ...
 $ : chr [1:5] " low in seafood omega-3 Mean daily intake of eicosapentaenoic acid and docosahexaenoic acid" "250 mg (200–300) per day" "94.9" "fatty acids" ...
 $ : chr [1:7] " low in polyunsaturated" "Mean daily intake of omega-6 fatty acids from all sources, mainly liquid vegetable oils," "11% (9–13) of total daily energy" "94.9" ...
 $ : chr [1:6] " high in trans fatty acids" "Mean daily intake of trans fat from all sources, mainly partially hydrogenated vegetable oils" "0.5% (0.0–1.0) of total daily energy" "36.9" ...
 $ : chr [1:8] " high in sodium" "24 h urinary sodium measured in g per day" "3 g (1–5) per day*" "26.2" ...

If we look closely, we can see that the sugar-sweetened beverage and the seafood category had only one space between the first and second columns - the columns about the dietary category and the one that describes in more detail what the consumption suggestion is about.

The values for these two columns appear to be together still in the same substring for these two categories. There are no quotation marks adjacent to the word "Mean".

Here you can see how the next substring should have started with the word "Mean" by the new inclusion of a quotation mark ".

We can add an extra space in front of the word "Mean" for these particular categories and then try splitting again.

Since we orginally split based on 2 or more spaces, we can just add a space in front of the word “Mean” for all the table strings and then try subsetting again.

[1]  9 12

We could also hust add a space in front of all the values of Mean in the table since the split was peformed based on 2 or more spaces. Thus the other elements in table would also be split just as before despite the additional space.

List of 15
 $ : chr [1:6] " low in fruits" "Mean daily consumption of fruits (fresh, frozen, cooked, canned, or dried fruits, excluding" "250 g (200–300) per day" "94.9" ...
 $ : chr [1:7] " low in vegetables" "Mean daily consumption of vegetables (fresh, frozen, cooked, canned, or dried vegetables," "360 g (290–430) per day" "94.9" ...
 $ : chr [1:5] " low in legumes" "Mean daily consumption of legumes (fresh, frozen, cooked, canned, or dried legumes)" "60 g (50–70) per day" "94.9" ...
 $ : chr [1:7] " low in whole grains" "Mean daily consumption of whole grains (bran, germ, and endosperm in their natural" "125 g (100–150) per day" "94.9" ...
 $ : chr [1:5] " low in nuts and seeds" "Mean daily consumption of nut and seed foods" "21 g (16–25) per day" "94.9" ...
 $ : chr [1:6] " low in milk" "Mean daily consumption of milk including non-fat, low-fat, and full-fat milk, excluding soy" "435 g (350–520) per day" "94.9" ...
 $ : chr [1:6] " high in red meat" "Mean daily consumption of red meat (beef, pork, lamb, and goat, but excluding poultry, fish," "23 g (18–27) per day" "94.9" ...
 $ : chr [1:6] " high in processed meat" "Mean daily consumption of meat preserved by smoking, curing, salting, or addition of" "2 g (0–4) per day" "36.9" ...
 $ : chr [1:7] " high in sugar-sweetened" "Mean daily consumption of beverages with ≥50 kcal per 226.8 serving, including carbonated" "3 g (0–5) per day" "36.9" ...
 $ : chr [1:6] " low in fibre" "Mean daily intake of fibre from all sources including fruits, vegetables, grains, legumes, and" "24 g (19–28) per day" "94.9" ...
 $ : chr [1:5] " low in calcium" "Mean daily intake of calcium from all sources, including milk, yogurt, and cheese" "1.25 g (1.00–1.50) per day" "94.9" ...
 $ : chr [1:6] " low in seafood omega-3" "Mean daily intake of eicosapentaenoic acid and docosahexaenoic acid" "250 mg (200–300) per day" "94.9" ...
 $ : chr [1:7] " low in polyunsaturated" "Mean daily intake of omega-6 fatty acids from all sources, mainly liquid vegetable oils," "11% (9–13) of total daily energy" "94.9" ...
 $ : chr [1:6] " high in trans fatty acids" "Mean daily intake of trans fat from all sources, mainly partially hydrogenated vegetable oils" "0.5% (0.0–1.0) of total daily energy" "36.9" ...
 $ : chr [1:8] " high in sodium" "24 h urinary sodium measured in g per day" "3 g (1–5) per day*" "26.2" ...

Looks better!

We want just the first (the food category) and third column (the optimal consumption amount suggested) for each row in the table.

We can use the map function of the purrr package to accomplish this.

The map function allows us to perform the same action multiple times across each element within an object.

This following will allow us to select the 1st or 3rd substring from each element of the table object.

[[1]]
[1] " low in fruits"

[[2]]
[1] " low in vegetables"

[[3]]
[1] " low in legumes"

[[4]]
[1] " low in whole grains"

[[5]]
[1] " low in nuts and seeds"

[[6]]
[1] " low in milk"
[[1]]
[1] "250 g (200–300) per day"

[[2]]
[1] "360 g (290–430) per day"

[[3]]
[1] "60 g (50–70) per day"

[[4]]
[1] "125 g (100–150) per day"

[[5]]
[1] "21 g (16–25) per day"

[[6]]
[1] "435 g (350–520) per day"

Now we will create a tibble using this data. However, currently both category and amount are of class list. To create a tibble we need to unlist the data to create vectors.

[1] "list"
[1] "character"

 [1] " low in fruits"             " low in vegetables"        
 [3] " low in legumes"            " low in whole grains"      
 [5] " low in nuts and seeds"     " low in milk"              
 [7] " high in red meat"          " high in processed meat"   
 [9] " high in sugar-sweetened"   " low in fibre"             
[11] " low in calcium"            " low in seafood omega-3"   
[13] " low in polyunsaturated"    " high in trans fatty acids"
[15] " high in sodium"           
 [1] "250 g (200–300) per day"             
 [2] "360 g (290–430) per day"             
 [3] "60 g (50–70) per day"                
 [4] "125 g (100–150) per day"             
 [5] "21 g (16–25) per day"                
 [6] "435 g (350–520) per day"             
 [7] "23 g (18–27) per day"                
 [8] "2 g (0–4) per day"                   
 [9] "3 g (0–5) per day"                   
[10] "24 g (19–28) per day"                
[11] "1.25 g (1.00–1.50) per day"          
[12] "250 mg (200–300) per day"            
[13] "11% (9–13) of total daily energy"    
[14] "0.5% (0.0–1.0) of total daily energy"
[15] "3 g (1–5) per day*"                  

We could have done all of this at once in one command like this:

Now we will create a tibble, which is an important data frame structure in the tidyverse which allows us to use other packages in the tidyverse with our data.

We will name our tibble columns now as we create our tibble using the tibble() function of both the tidyr and the tibble packages, as names are required in tibbles.

# A tibble: 15 x 2
   category                     amount                              
   <chr>                        <chr>                               
 1 " low in fruits"             250 g (200–300) per day             
 2 " low in vegetables"         360 g (290–430) per day             
 3 " low in legumes"            60 g (50–70) per day                
 4 " low in whole grains"       125 g (100–150) per day             
 5 " low in nuts and seeds"     21 g (16–25) per day                
 6 " low in milk"               435 g (350–520) per day             
 7 " high in red meat"          23 g (18–27) per day                
 8 " high in processed meat"    2 g (0–4) per day                   
 9 " high in sugar-sweetened"   3 g (0–5) per day                   
10 " low in fibre"              24 g (19–28) per day                
11 " low in calcium"            1.25 g (1.00–1.50) per day          
12 " low in seafood omega-3"    250 mg (200–300) per day            
13 " low in polyunsaturated"    11% (9–13) of total daily energy    
14 " high in trans fatty acids" 0.5% (0.0–1.0) of total daily energy
15 " high in sodium"            3 g (1–5) per day*                  

Looking pretty good!

However, we want to separate the different amounts within the amount column.

Recall what the orginal table looked like:

Separating values within a variable

We can use the tidyr::separate() function to separate the data within the amount column into three new columns based on the optimal level and the optimal range. We can separate the values based on the open parantheses "(" and the long dash "–" characters.

# A tibble: 6 x 4
  category                 optimal  lower upper       
  <chr>                    <chr>    <chr> <chr>       
1 " low in fruits"         "250 g " 200   300) per day
2 " low in vegetables"     "360 g " 290   430) per day
3 " low in legumes"        "60 g "  50    70) per day 
4 " low in whole grains"   "125 g " 100   150) per day
5 " low in nuts and seeds" "21 g "  16    25) per day 
6 " low in milk"           "435 g " 350   520) per day

Let’s Also create a new variable/column in our tibble that indicates the direction that can be harmful for each dietary factor.

# A tibble: 15 x 5
   direction food              optimal   lower upper                     
   <chr>     <chr>             <chr>     <chr> <chr>                     
 1 " low"    fruits            "250 g "  200   300) per day              
 2 " low"    vegetables        "360 g "  290   430) per day              
 3 " low"    legumes           "60 g "   50    70) per day               
 4 " low"    whole grains      "125 g "  100   150) per day              
 5 " low"    nuts and seeds    "21 g "   16    25) per day               
 6 " low"    milk              "435 g "  350   520) per day              
 7 " high"   red meat          "23 g "   18    27) per day               
 8 " high"   processed meat    "2 g "    0     4) per day                
 9 " high"   sugar-sweetened   "3 g "    0     5) per day                
10 " low"    fibre             "24 g "   19    28) per day               
11 " low"    calcium           "1.25 g " 1.00  1.50) per day             
12 " low"    seafood omega-3   "250 mg " 200   300) per day              
13 " low"    polyunsaturated   "11% "    9     13) of total daily energy 
14 " high"   trans fatty acids "0.5% "   0.0   1.0) of total daily energy
15 " high"   sodium            "3 g "    1     5) per day*               

If we wanted to remove the direction variable we could use the purrr::modify_at() function:

Data cleaning with regular expressions

Ok, looking better, but we still need a bit of cleaning to remove symbols and extra words from the columns. Some of the extra symbols include: "%", ")" and the "*".

The "*" and the ")" are what we call metacharacters or regular expressions. These are characters that have special meanings.

Now we need the "\\" to indicate that we want these characters to be matched exactly and not interpreted as the meaning of the symbol.

See here for more info about regular expressions in R.

Also here we have a bit of an example using the str_count() function of stringr, which counts the number of instences of a character string. In this case we will look for individual characters but you could also search for words or phrases.

[1] "Testing for ts or\ttabs can be tricky.(yes, it really can!*)\n"
[1] 5
[1] 1
[1] 1
[1] 1
[1] 1

We also want to make a unit variable so that we can make sure that our units are consistent later.

 [1] "250 g "  "360 g "  "60 g "   "125 g "  "21 g "   "435 g "  "23 g "  
 [8] "2 g "    "3 g "    "24 g "   "1.25 g " "250 mg " "11% "    "0.5% "  
[15] "3 g "   

Notice that the values that are percentages dont have spaces between the number and the unit. We can separate the optimal values by a space or a percent symbol "%" using "|" to indicate that we want to separate by either. In this case we will lose the “%” and will need to add it back to those values.

# A tibble: 15 x 6
   direction food              lower optimal unit  upper                   
   <chr>     <chr>             <chr> <chr>   <chr> <chr>                   
 1 " low"    fruits            200   250     g     300) per day            
 2 " low"    vegetables        290   360     g     430) per day            
 3 " low"    legumes           50    60      g     70) per day             
 4 " low"    whole grains      100   125     g     150) per day            
 5 " low"    nuts and seeds    16    21      g     25) per day             
 6 " low"    milk              350   435     g     520) per day            
 7 " high"   red meat          18    23      g     27) per day             
 8 " high"   processed meat    0     2       g     4) per day              
 9 " high"   sugar-sweetened   0     3       g     5) per day              
10 " low"    fibre             19    24      g     28) per day             
11 " low"    calcium           1.00  1.25    g     1.50) per day           
12 " low"    seafood omega-3   200   250     mg    300) per day            
13 " low"    polyunsaturated   9     11      ""    13) of total daily ener…
14 " high"   trans fatty acids 0.0   0.5     ""    1.0) of total daily ene…
15 " high"   sodium            1     3       g     5) per day*             

Great, so to now we will add “%” to the unit variable for the low in polyunsaturated and high in trans fatty acids rows.

First we need to replace the empty values with NA using the na_if() function of the dplyr package.

# A tibble: 15 x 6
   direction food              lower optimal unit  upper                   
   <chr>     <chr>             <chr> <chr>   <chr> <chr>                   
 1 " low"    fruits            200   250     g     300) per day            
 2 " low"    vegetables        290   360     g     430) per day            
 3 " low"    legumes           50    60      g     70) per day             
 4 " low"    whole grains      100   125     g     150) per day            
 5 " low"    nuts and seeds    16    21      g     25) per day             
 6 " low"    milk              350   435     g     520) per day            
 7 " high"   red meat          18    23      g     27) per day             
 8 " high"   processed meat    0     2       g     4) per day              
 9 " high"   sugar-sweetened   0     3       g     5) per day              
10 " low"    fibre             19    24      g     28) per day             
11 " low"    calcium           1.00  1.25    g     1.50) per day           
12 " low"    seafood omega-3   200   250     mg    300) per day            
13 " low"    polyunsaturated   9     11      <NA>  13) of total daily ener…
14 " high"   trans fatty acids 0.0   0.5     <NA>  1.0) of total daily ene…
15 " high"   sodium            1     3       g     5) per day*             

Then to replace the NA values, we can use the replace_na() function in the tidyr package and the mutate() function of dplyr to specify which values to replace, in this case the NA values within the variable unit. Essentially this variable gets reasigned with the new values, as we mostly think of the mutate() function as creating new variables.

# A tibble: 2 x 6
  direction food              lower optimal unit  upper                    
  <chr>     <chr>             <chr> <chr>   <chr> <chr>                    
1 " low"    polyunsaturated   9     11      %     13) of total daily energy
2 " high"   trans fatty acids 0.0   0.5     %     1.0) of total daily ener…

Let’s also move unit to be the last column. We can use the select() and everything() functions of the dplyr package to do this.

Here you can see Hadley Wickham’s (Chief Scientist at RStudio) explanation for this behavior of select():

https://github.com/tidyverse/dplyr/issues/2838#issuecomment-306062800

To remove all of the remaining extra characters and words we will again use the stringr package. This time we will use the str_remove_all() function to remove all instances of these characters.

Nice! that’s pretty clean but we can do a bit more.

Data type conversion

One of the next things to notice about our data is the character classes of our variables.

Notice that the optimal amounts of consumption are currently of class character as indicated by the <chr> just below the column names / variable names of the guidelines tibble:

# A tibble: 15 x 6
   direction food              lower optimal upper unit 
   <chr>     <chr>             <chr> <chr>   <chr> <chr>
 1 " low"    fruits            200   250     300   g    
 2 " low"    vegetables        290   360     430   g    
 3 " low"    legumes           50    60      70    g    
 4 " low"    whole grains      100   125     150   g    
 5 " low"    nuts and seeds    16    21      25    g    
 6 " low"    milk              350   435     520   g    
 7 " high"   red meat          18    23      27    g    
 8 " high"   processed meat    0     2       4     g    
 9 " high"   sugar-sweetened   0     3       5     g    
10 " low"    fibre             19    24      28    g    
11 " low"    calcium           1.00  1.25    1.50  g    
12 " low"    seafood omega-3   200   250     300   mg   
13 " low"    polyunsaturated   9     11      13    %    
14 " high"   trans fatty acids 0.0   0.5     1.0   %    
15 " high"   sodium            1     3       5     g    

To convert these values to numeric we can use the mutate_at() function of the dplyr package.

The mutate_at() function allows us to perform a function on specific columns/variables within a tibble. We need to indicate which variables that we would like to convert using vars(). In this case if we look at the beginning of the guidelines tibble, we can see that optimal, lower and upper should be converted. As these three columns are sequential, we can simply put a : between optimal and upper to indicate that we want all the variables in between these columns to be converted.

# A tibble: 15 x 6
   direction food              lower optimal upper unit 
   <chr>     <chr>             <dbl>   <dbl> <dbl> <chr>
 1 " low"    fruits              200  250    300   g    
 2 " low"    vegetables          290  360    430   g    
 3 " low"    legumes              50   60     70   g    
 4 " low"    whole grains        100  125    150   g    
 5 " low"    nuts and seeds       16   21     25   g    
 6 " low"    milk                350  435    520   g    
 7 " high"   red meat             18   23     27   g    
 8 " high"   processed meat        0    2      4   g    
 9 " high"   sugar-sweetened       0    3      5   g    
10 " low"    fibre                19   24     28   g    
11 " low"    calcium               1    1.25   1.5 g    
12 " low"    seafood omega-3     200  250    300   mg   
13 " low"    polyunsaturated       9   11     13   %    
14 " high"   trans fatty acids     0    0.5    1   %    
15 " high"   sodium                1    3      5   g    

Great! Now these variables are of class <dbl> (stands for double) which indicates that they are numeric. Here is a link for more info on numeric classes in R.

If we had not replaced the "·" interpunct values to a period conversion from character to numeric will be problematic and will result in NA values.

Data value reassignments

We seem to have lost the word "beverages" from the "sugar-sweetened beverages" category, as well as "fatty acids" from the "seafood omega 3 fatty acids", and the "polyunsaturated fatty acids" categories as the full category name was listed on two lines within the table. We would like to replace these values with the full name.

To select the food column we will show you several options. Only a couple will work well with reassigning the data in that particular variable within guidelines without assigning an intermediate data object. We will look using mutate_at(), pull(), select(), and brackets [,c("variable name")].

The bracket option and the select() option will grab a tibble (data frame) version of the food column out of guidelines. However we can’t start commands with select for assignments.

# A tibble: 15 x 1
   food             
   <chr>            
 1 fruits           
 2 vegetables       
 3 legumes          
 4 whole grains     
 5 nuts and seeds   
 6 milk             
 7 red meat         
 8 processed meat   
 9 sugar-sweetened  
10 fibre            
11 calcium          
12 seafood omega-3  
13 polyunsaturated  
14 trans fatty acids
15 sodium           
# A tibble: 15 x 1
   food             
   <chr>            
 1 fruits           
 2 vegetables       
 3 legumes          
 4 whole grains     
 5 nuts and seeds   
 6 milk             
 7 red meat         
 8 processed meat   
 9 sugar-sweetened  
10 fibre            
11 calcium          
12 seafood omega-3  
13 polyunsaturated  
14 trans fatty acids
15 sodium           

pull() in contrast, will grab the vector version of the food data:

 [1] "fruits"            "vegetables"        "legumes"          
 [4] "whole grains"      "nuts and seeds"    "milk"             
 [7] "red meat"          "processed meat"    "sugar-sweetened"  
[10] "fibre"             "calcium"           "seafood omega-3"  
[13] "polyunsaturated"   "trans fatty acids" "sodium"           

The pull function can be very useful when combined with other functions (for example you typically want to use a vector with the str_replace() function), but just like select, we can’t start assignments with pull().

This is not possible and will result in an error:

This will only print the result, but not reassign the food variable values:

 [1] "fruits"                    "vegetables"               
 [3] "legumes"                   "whole grains"             
 [5] "nuts and seeds"            "milk"                     
 [7] "red meat"                  "processed meat"           
 [9] "sugar-sweetened beverages" "fibre"                    
[11] "calcium"                   "seafood omega-3"          
[13] "polyunsaturated"           "trans fatty acids"        
[15] "sodium"                   

Using select() would work as well to print the result (although the result structure is different):

[1] "c(\"fruits\", \"vegetables\", \"legumes\", \"whole grains\", \"nuts and seeds\", \"milk\", \"red meat\", \"processed meat\", \"sugar-sweetened beverages\", \"fibre\", \"calcium\", \"seafood omega-3\", \"polyunsaturated\", \"trans fatty acids\", \"sodium\")"

Question opportunity:

Why do these commands not reassign the food variable values?

The bracket option is great alternative and allows us to reassign the values within guidelines easily

# A tibble: 15 x 6
   direction food                        lower optimal upper unit 
   <chr>     <chr>                       <dbl>   <dbl> <dbl> <chr>
 1 " low"    fruits                        200  250    300   g    
 2 " low"    vegetables                    290  360    430   g    
 3 " low"    legumes                        50   60     70   g    
 4 " low"    whole grains                  100  125    150   g    
 5 " low"    nuts and seeds                 16   21     25   g    
 6 " low"    milk                          350  435    520   g    
 7 " high"   red meat                       18   23     27   g    
 8 " high"   processed meat                  0    2      4   g    
 9 " high"   sugar-sweetened beverages       0    3      5   g    
10 " low"    fibre                          19   24     28   g    
11 " low"    calcium                         1    1.25   1.5 g    
12 " low"    seafood omega-3 fatty acids   200  250    300   mg   
13 " low"    polyunsaturated                 9   11     13   %    
14 " high"   trans fatty acids               0    0.5    1   %    
15 " high"   sodium                          1    3      5   g    

Finally, the best option is probably the mutate_at() function from dplyr. In this case we need to include ~ in front of the function that we would like to use on the values in our food variables. We also include . as a replacement to reference the data that we want to use within str_replace() (which in this case is the food variable values of guidelines).

Notice we didn’t need this when we previously use mutate_at() with the as.numeric() function. This is becuase the str_replace() function requires us to specify what data we are using as one of the arguments, while as.numeric() does not.

# A tibble: 15 x 6
   direction food                        lower optimal upper unit 
   <chr>     <chr>                       <dbl>   <dbl> <dbl> <chr>
 1 " low"    fruits                        200  250    300   g    
 2 " low"    vegetables                    290  360    430   g    
 3 " low"    legumes                        50   60     70   g    
 4 " low"    whole grains                  100  125    150   g    
 5 " low"    nuts and seeds                 16   21     25   g    
 6 " low"    milk                          350  435    520   g    
 7 " high"   red meat                       18   23     27   g    
 8 " high"   processed meat                  0    2      4   g    
 9 " high"   sugar-sweetened beverages       0    3      5   g    
10 " low"    fibre                          19   24     28   g    
11 " low"    calcium                         1    1.25   1.5 g    
12 " low"    seafood omega-3 fatty acids   200  250    300   mg   
13 " low"    polyunsaturated fatty acids     9   11     13   %    
14 " high"   trans fatty acids               0    0.5    1   %    
15 " high"   sodium                          1    3      5   g    

This might be considered a better option because it is more readible as to where the food data came from that we are replacing values within.

There is one last minor detail… the direction variable has leading spaces still. We can use str_trim() to fix that!

# A tibble: 15 x 6
   direction food                        lower optimal upper unit 
   <chr>     <chr>                       <dbl>   <dbl> <dbl> <chr>
 1 low       fruits                        200  250    300   g    
 2 low       vegetables                    290  360    430   g    
 3 low       legumes                        50   60     70   g    
 4 low       whole grains                  100  125    150   g    
 5 low       nuts and seeds                 16   21     25   g    
 6 low       milk                          350  435    520   g    
 7 high      red meat                       18   23     27   g    
 8 high      processed meat                  0    2      4   g    
 9 high      sugar-sweetened beverages       0    3      5   g    
10 low       fibre                          19   24     28   g    
11 low       calcium                         1    1.25   1.5 g    
12 low       seafood omega-3 fatty acids   200  250    300   mg   
13 low       polyunsaturated fatty acids     9   11     13   %    
14 high      trans fatty acids               0    0.5    1   %    
15 high      sodium                          1    3      5   g    

OK! Now we know how much of each dietary factor we generally need for optimal health according to the guidelines used in this article.

We would like to see how the mean consumption rates for the different groups of people compared to the optimal intake guidelines.

One way we could do this is to calculate a consumption percentage of the optimal value.

To calculate this it would be helpful to put the guideline amounts with the average consumption rates into the same tibble, especially because the observed consumption data (diet_data and sep_age_diet_data) are very different dimensions from the guidelines data.

In order to create a tibble with our observed consumption rates with the suggested consumption rates, we will join our data using dplyr. In order to do so it is important that our different datasets have the same values. So let’s first assess if that is the case.

Comparing data

# A tibble: 15 x 1
   rei_name                               
   <chr>                                  
 1 Diet low in fruits                     
 2 Diet low in vegetables                 
 3 Diet low in whole grains               
 4 Diet low in nuts and seeds             
 5 Diet low in milk                       
 6 Diet high in red meat                  
 7 Diet high in processed meat            
 8 Diet high in sugar-sweetened beverages 
 9 Diet low in fiber                      
10 Diet low in seafood omega-3 fatty acids
11 Diet low in polyunsaturated fatty acids
12 Diet high in trans fatty acids         
13 Diet high in sodium                    
14 Diet low in calcium                    
15 Diet low in legumes                    
# A tibble: 15 x 1
   food                       
   <chr>                      
 1 fruits                     
 2 vegetables                 
 3 legumes                    
 4 whole grains               
 5 nuts and seeds             
 6 milk                       
 7 red meat                   
 8 processed meat             
 9 sugar-sweetened beverages  
10 fibre                      
11 calcium                    
12 seafood omega-3 fatty acids
13 polyunsaturated fatty acids
14 trans fatty acids          
15 sodium                     

We can see that we need to remove the "Diet low in" and "Diet high in" phrases from the observed consumption data.

Also let’s double check that the two observed files have the same exact values for dietary factor names.

We can use the setequal() function from dplyr to check that the unique values for rei_name are the same for both diet_data and sep_age_diet_data.

[1] TRUE

Great!

Note that the default of the set_equal function ignores the order of values in rows. So we still dont know if the order is the same.

We can check using the all_equal function of dplyr which reports back clues about what might be different if anything. Importantly we are including ignore_row_order = FALSE as the default is TRUE.

[1] TRUE

Looks like they are also in the same order.

Note that if any of the values are different all_equal() will first report this and will not report that the rows are in a different order.

Here is a toy example about how the three comparison functions(setequal(), all_equal() (also all.equal() for tbl_df), and setdiff()) work in dplyr.

It’s important to realize that row order is ignored by bothsetequal() and setdiff().

Now let’s compare two tibbles that have different row orders and differnt values.

Here are our tibbles to compare:

# A tibble: 4 x 1
  test 
  <chr>
1 A    
2 B    
3 AC   
4 D    
# A tibble: 4 x 1
  test 
  <chr>
1 A    
2 D    
3 AG   
4 B    
[1] "tbl_df"     "tbl"        "data.frame"

Since we are using tibbles, which are of class tbl_df we can use either all_equal or all.equal().

[1] "Rows in x but not y: 3. Rows in y but not x: 3. "
[1] "Rows in x but not y: 3. Rows in y but not x: 3. "
[1] "Rows in x but not y: 3. Rows in y but not x: 3. "
[1] "Rows in x but not y: 3. Rows in y but not x: 3. "
[1] FALSE
# A tibble: 1 x 1
  test 
  <chr>
1 AC   
# A tibble: 1 x 1
  test 
  <chr>
1 AG   

Now let’s make it so that only the order is different:

# A tibble: 4 x 1
  test 
  <chr>
1 A    
2 B    
3 AC   
4 D    
# A tibble: 4 x 1
  test 
  <chr>
1 A    
2 D    
3 AC   
4 B    
[1] TRUE
[1] "Same row values, but different order"
[1] TRUE
# A tibble: 0 x 1
# … with 1 variable: test <chr>

If we have different column/variable names this makes comparisons more challenging:

[1] "Cols in y but not x: `test2`. " "Cols in x but not y: `test`. " 
[1] "Cols in y but not x: `test2`. " "Cols in x but not y: `test`. " 
[1] FALSE

Ok, let’s keep going with our data.

How similar are the guidelines tibble and the observed consumption tibbles?

[1] FALSE

Ok, looks like we have some different values.

Let’s use the setdiff function to get more information about what is different between the values.

:( That wont work. This is because setdiff() requires that the colnames are the same in the objects that we are comparing.

We can use the rename() of dplyr function to do this. We list the value that we want to change to first. We find “food” more intuitive so we are going to change “rei_name” to “food” for the diet_data and the sep_age_diet_data

Great, now we know that the fiber value appears to be different between the two.

# A tibble: 1 x 1
  food 
  <chr>
1 fibre

Changing the order of the objects, we can see that in the table from the article that we used to create guidelines, “fibre” the British spelling is used in contrast to the dataset which uses the American spelling “fiber”.

Let’s stick with the American spelling, so we will replace "fibre" in the guideline tibble. Again, we have two options for doing this:

# A tibble: 1 x 6
  direction food  lower optimal upper unit 
  <chr>     <chr> <dbl>   <dbl> <dbl> <chr>
1 low       fiber    19      24    28 g    

Now let’s check again to see that our food values match between the guidelines and the observed consumption data tibbles.

# A tibble: 0 x 1
# … with 1 variable: food <chr>
# A tibble: 0 x 1
# … with 1 variable: food <chr>

Great! There are no differences :)

Joining data

Now we can put our guideline data together with the diet_data and the sep_age_diet_data.

Remeber that the food data in our guidelines tibble is not necessarily in the same order as that of the consumption data tibbles. Thus this could be a problem if we decided to expand the guidelines rows (to repeat for the number of fruit observations etc.) and add them to our observed consumption tibbles.

In that case we could use the arrange() function of dplyr to sort the data alphabetically.

However, we will instead use a joining function of dplyr. These functions combine the data together based on common values. There are a variety of options.

In our case we would like to retain all of the values of diet_data and sep_age_diet_data. We would like to add new columns of values to these tibbles that correspond to the guideline information about amounts of consumption for each food type in the guidelines tibble. We shouldn’t have any values of food in guidelines that dont match, so we will not get any NA values. Therefore, in our case any of the mutating join functions should result in the same output.

It’s important to check if we have any overlapping variable names before we join the data. We can use the base R function names() and the intersect() function of the dplyr package for this.

[1] "food"  "upper" "lower" "unit" 

So it looks like the "upper" , "lower" and "unit" variable names are overlapping. Therefore, to distinguish the names later we will rename the guideline "upper" , "lower" and "unit" variables.

We will again use the rename function from the dplyr package. We can list multiple variables to rename and separate each with a comma.

# A tibble: 15 x 6
   direction food          lower_optimal optimal upper_optimal unit_optimal
   <chr>     <chr>                 <dbl>   <dbl>         <dbl> <chr>       
 1 low       fruits                  200  250            300   g           
 2 low       vegetables              290  360            430   g           
 3 low       legumes                  50   60             70   g           
 4 low       whole grains            100  125            150   g           
 5 low       nuts and see…            16   21             25   g           
 6 low       milk                    350  435            520   g           
 7 high      red meat                 18   23             27   g           
 8 high      processed me…             0    2              4   g           
 9 high      sugar-sweete…             0    3              5   g           
10 low       fiber                    19   24             28   g           
11 low       calcium                   1    1.25           1.5 g           
12 low       seafood omeg…           200  250            300   mg          
13 low       polyunsatura…             9   11             13   %           
14 high      trans fatty …             0    0.5            1   %           
15 high      sodium                    1    3              5   g           

It’s also a good idea to check our units to make sure they are the same for both guidelines and the observed consumption tibbles: diet_and_guidelines and all_age_diet_and_guidelines.

Let’s take a look with the count() function of dplyr.

# A tibble: 15 x 9
   unit   food          n unit1  food1       n1 unit_optimal food2       n2
   <chr>  <chr>     <int> <chr>  <chr>    <int> <chr>        <chr>    <int>
 1 %ener… polyunsa…   392 %ener… polyuns…  5880 %            polyuns…     1
 2 %ener… trans fa…   392 %ener… trans f…  5880 %            trans f…     1
 3 g/day  calcium     392 g/day  calcium   5880 g            calcium      1
 4 g/day  fiber       392 g/day  fiber     5880 g            fiber        1
 5 g/day  fruits      392 g/day  fruits    5880 g            fruits       1
 6 g/day  legumes     392 g/day  legumes   5880 g            legumes      1
 7 g/day  milk        392 g/day  milk      5880 g            milk         1
 8 g/day  nuts and…   392 g/day  nuts an…  5880 g            nuts an…     1
 9 g/day  processe…   392 g/day  process…  5880 g            process…     1
10 g/day  red meat    392 g/day  red meat  5880 g            red meat     1
11 g/day  seafood …   392 g/day  seafood…  5880 g            sodium       1
12 g/day  sodium      392 g/day  sodium    5880 g            sugar-s…     1
13 g/day  sugar-sw…   392 g/day  sugar-s…  5880 g            vegetab…     1
14 g/day  vegetabl…   392 g/day  vegetab…  5880 g            whole g…     1
15 g/day  whole gr…   392 g/day  whole g…  5880 mg           seafood…     1

We can see that the only potential issue is the seafood omega-3 fatty acids data which is in g/day for the observed data(diet_data and all_age_diet_and_guidelines), but the unit is mg/day in the guidelines data.

We can account for this by dividing the guideline seafood omega-3 fatty acids data by 1000 to convert it to grams from milligrams.

To do this we will use the if_else() function in the dplyr package. This allows us to specify a condition (in this case if the unit is "mg"), as well as values if this is codition is met (true), or if the condition is not met (false). In the following we mutate the values in each of the guideline numeric columns (lower, optimal and upper) one at a time. When we refer to lower for example we refer to the values in the column/varaible. So if the condition is not met, then the original value is retained. We will also replace "mg" with "g" after everything is converted to grams.

# A tibble: 15 x 6
   direction food          lower_optimal optimal upper_optimal unit_optimal
   <chr>     <chr>                 <dbl>   <dbl>         <dbl> <chr>       
 1 low       fruits                200    250            300   g           
 2 low       vegetables            290    360            430   g           
 3 low       legumes                50     60             70   g           
 4 low       whole grains          100    125            150   g           
 5 low       nuts and see…          16     21             25   g           
 6 low       milk                  350    435            520   g           
 7 high      red meat               18     23             27   g           
 8 high      processed me…           0      2              4   g           
 9 high      sugar-sweete…           0      3              5   g           
10 low       fiber                  19     24             28   g           
11 low       calcium                 1      1.25           1.5 g           
12 low       seafood omeg…           0.2    0.25           0.3 g           
13 low       polyunsatura…           9     11             13   %           
14 high      trans fatty …           0      0.5            1   %           
15 high      sodium                  1      3              5   g           

THIS IS WORK to try to mutate all at once… can delete or keep working on…

# A tibble: 1 x 6
  direction food           lower_optimal optimal upper_optimal unit_optimal
  <chr>     <chr>                  <dbl>   <dbl>         <dbl> <chr>       
1 low       seafood omega…        0.0002 0.00025      0.000300 g           

Now we are ready to join the data!

Agian, we would like to add new columns of values to diet_data and all_age_diet_and_guidelines that correspond to the guideline information about amounts of consumption for each food type in the guidelines tibble. So we will join the data based on the food variable values.

Observations: 5,880
Variables: 16
$ year_id        <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2…
$ location_name  <chr> "Global", "Global", "Global", "Global", "Global",…
$ rei_id         <dbl> 111, 111, 112, 112, 113, 113, 114, 114, 115, 115,…
$ food           <chr> "fruits", "fruits", "vegetables", "vegetables", "…
$ age_group_name <chr> "All Available Ages", "All Available Ages", "All …
$ sex            <chr> "Male", "Female", "Male", "Female", "Male", "Fema…
$ parameter      <chr> "continuous", "continuous", "continuous", "contin…
$ mean           <dbl> 8.703202e+01, 9.953182e+01, 1.975187e+02, 1.83233…
$ upper          <dbl> 8.988734e+01, 1.023450e+02, 2.083679e+02, 1.92110…
$ lower          <dbl> 8.452347e+01, 9.672140e+01, 1.887154e+02, 1.75401…
$ unit           <chr> "g/day", "g/day", "g/day", "g/day", "g/day", "g/d…
$ direction      <chr> "low", "low", "low", "low", "low", "low", "low", …
$ lower_optimal  <dbl> 200.0, 200.0, 290.0, 290.0, 100.0, 100.0, 16.0, 1…
$ optimal        <dbl> 250.00, 250.00, 360.00, 360.00, 125.00, 125.00, 2…
$ upper_optimal  <dbl> 300.0, 300.0, 430.0, 430.0, 150.0, 150.0, 25.0, 2…
$ unit_optimal   <chr> "g", "g", "g", "g", "g", "g", "g", "g", "g", "g",…
Observations: 88,200
Variables: 16
$ year_id        <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2…
$ location_name  <chr> "Global", "Global", "Global", "Global", "Global",…
$ food           <chr> "fruits", "fruits", "fruits", "fruits", "fruits",…
$ age_group_id   <dbl> 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 3…
$ age_group_name <chr> "25 to 29", "30 to 34", "35 to 39", "40 to 44", "…
$ sex            <chr> "Male", "Male", "Male", "Male", "Male", "Male", "…
$ parameter      <chr> "continuous", "continuous", "continuous", "contin…
$ mean           <dbl> 68.54567, 72.62209, 76.73157, 81.03910, 88.79202,…
$ upper          <dbl> 75.16806, 80.00433, 84.73205, 89.52747, 100.94301…
$ lower          <dbl> 63.17081, 66.78018, 71.04691, 73.82734, 80.40971,…
$ unit           <chr> "g/day", "g/day", "g/day", "g/day", "g/day", "g/d…
$ direction      <chr> "low", "low", "low", "low", "low", "low", "low", …
$ lower_optimal  <dbl> 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,…
$ optimal        <dbl> 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,…
$ upper_optimal  <dbl> 300, 300, 300, 300, 300, 300, 300, 300, 300, 300,…
$ unit_optimal   <chr> "g", "g", "g", "g", "g", "g", "g", "g", "g", "g",…

It’s always a good idea to check that the values are what you expect after merging.

# A tibble: 15 x 3
   food                        optimal     n
   <chr>                         <dbl> <int>
 1 calcium                        1.25   392
 2 fiber                         24      392
 3 fruits                       250      392
 4 legumes                       60      392
 5 milk                         435      392
 6 nuts and seeds                21      392
 7 polyunsaturated fatty acids   11      392
 8 processed meat                 2      392
 9 red meat                      23      392
10 seafood omega-3 fatty acids    0.25   392
11 sodium                         3      392
12 sugar-sweetened beverages      3      392
13 trans fatty acids              0.5    392
14 vegetables                   360      392
15 whole grains                 125      392
# A tibble: 15 x 3
   food                        optimal     n
   <chr>                         <dbl> <int>
 1 calcium                        1.25  5880
 2 fiber                         24     5880
 3 fruits                       250     5880
 4 legumes                       60     5880
 5 milk                         435     5880
 6 nuts and seeds                21     5880
 7 polyunsaturated fatty acids   11     5880
 8 processed meat                 2     5880
 9 red meat                      23     5880
10 seafood omega-3 fatty acids    0.25  5880
11 sodium                         3     5880
12 sugar-sweetened beverages      3     5880
13 trans fatty acids              0.5   5880
14 vegetables                   360     5880
15 whole grains                 125     5880
# A tibble: 15 x 6
   direction food          lower_optimal optimal upper_optimal unit_optimal
   <chr>     <chr>                 <dbl>   <dbl>         <dbl> <chr>       
 1 low       fruits                200    250            300   g           
 2 low       vegetables            290    360            430   g           
 3 low       legumes                50     60             70   g           
 4 low       whole grains          100    125            150   g           
 5 low       nuts and see…          16     21             25   g           
 6 low       milk                  350    435            520   g           
 7 high      red meat               18     23             27   g           
 8 high      processed me…           0      2              4   g           
 9 high      sugar-sweete…           0      3              5   g           
10 low       fiber                  19     24             28   g           
11 low       calcium                 1      1.25           1.5 g           
12 low       seafood omeg…           0.2    0.25           0.3 g           
13 low       polyunsatura…           9     11             13   %           
14 high      trans fatty …           0      0.5            1   %           
15 high      sodium                  1      3              5   g           

Looks good!

Calculate relative consumption

Again, we would like to compare the consumption rates of this dietary factors by different groups of people, but ideally we want to know this relative to the optimal guidelines.

Thus lets calcuate values of consuption that are relative to the suggested guidelines.

There are a few ways we could do this. One is to calculate a percentage of consumption based on the mean value for each observed value relative to the optimal value. To do this we will use the mutate() function of the dplyrpackage. This will create a new variable called mean_percent that will be equal to the division result of the mean variable value and the optimal variable multiplied by 100 to create a percentage.

Another option is to incorperate the range of optimal intakes and the direction that is associated with health risk. If the direction of risk is high and the consumption was greater than the optimal mean value, than the percentage is calculated based on the upper_optimal value, while if the direction of risk is low and the consumption is less than the optimal mean value, then the percentage is calculated based on the lower_optimal value. We will use the case_when() function of the dplyr package to do this. This allows us to specify values (indicated on the right side of the ~symbol) based on specific conditions (indicated on the left side of the ~ symbol). We can specify multiple conditions using the & symbol.

Yet another option is to create a binary outcome of if optimal consumption was achieved or not.

Observations: 5,880
Variables: 20
$ year_id            <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 201…
$ location_name      <chr> "Global", "Global", "Global", "Global", "Glob…
$ rei_id             <dbl> 111, 111, 112, 112, 113, 113, 114, 114, 115, …
$ food               <chr> "fruits", "fruits", "vegetables", "vegetables…
$ age_group_name     <chr> "All Available Ages", "All Available Ages", "…
$ sex                <chr> "Male", "Female", "Male", "Female", "Male", "…
$ parameter          <chr> "continuous", "continuous", "continuous", "co…
$ mean               <dbl> 8.703202e+01, 9.953182e+01, 1.975187e+02, 1.8…
$ upper              <dbl> 8.988734e+01, 1.023450e+02, 2.083679e+02, 1.9…
$ lower              <dbl> 8.452347e+01, 9.672140e+01, 1.887154e+02, 1.7…
$ unit               <chr> "g/day", "g/day", "g/day", "g/day", "g/day", …
$ direction          <chr> "low", "low", "low", "low", "low", "low", "lo…
$ lower_optimal      <dbl> 200.0, 200.0, 290.0, 290.0, 100.0, 100.0, 16.…
$ optimal            <dbl> 250.00, 250.00, 360.00, 360.00, 125.00, 125.0…
$ upper_optimal      <dbl> 300.0, 300.0, 430.0, 430.0, 150.0, 150.0, 25.…
$ unit_optimal       <chr> "g", "g", "g", "g", "g", "g", "g", "g", "g", …
$ mean_percent       <dbl> 34.8128083, 39.8127275, 54.8663179, 50.898279…
$ range_percent      <dbl> 43.5160103, 49.7659094, 68.1099118, 63.184071…
$ percent_over_under <dbl> 56.483990, 50.234091, 31.890088, 36.815929, 7…
$ opt_achieved       <chr> "No", "No", "No", "No", "No", "No", "No", "No…
Observations: 88,200
Variables: 20
$ year_id            <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 201…
$ location_name      <chr> "Global", "Global", "Global", "Global", "Glob…
$ food               <chr> "fruits", "fruits", "fruits", "fruits", "frui…
$ age_group_id       <dbl> 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 3…
$ age_group_name     <chr> "25 to 29", "30 to 34", "35 to 39", "40 to 44…
$ sex                <chr> "Male", "Male", "Male", "Male", "Male", "Male…
$ parameter          <chr> "continuous", "continuous", "continuous", "co…
$ mean               <dbl> 68.54567, 72.62209, 76.73157, 81.03910, 88.79…
$ upper              <dbl> 75.16806, 80.00433, 84.73205, 89.52747, 100.9…
$ lower              <dbl> 63.17081, 66.78018, 71.04691, 73.82734, 80.40…
$ unit               <chr> "g/day", "g/day", "g/day", "g/day", "g/day", …
$ direction          <chr> "low", "low", "low", "low", "low", "low", "lo…
$ lower_optimal      <dbl> 200, 200, 200, 200, 200, 200, 200, 200, 200, …
$ optimal            <dbl> 250, 250, 250, 250, 250, 250, 250, 250, 250, …
$ upper_optimal      <dbl> 300, 300, 300, 300, 300, 300, 300, 300, 300, …
$ unit_optimal       <chr> "g", "g", "g", "g", "g", "g", "g", "g", "g", …
$ mean_percent       <dbl> 27.41827, 29.04883, 30.69263, 32.41564, 35.51…
$ range_percent      <dbl> 34.27284, 36.31104, 38.36578, 40.51955, 44.39…
$ percent_over_under <dbl> 65.72716, 63.68896, 61.63422, 59.48045, 55.60…
$ opt_achieved       <chr> "No", "No", "No", "No", "No", "No", "No", "No…

One last thing that can be useful with data wrangling is to reshape the data into what is called the long format. This is very useful for creating visualizations with a very useful package called ggplot2.

To coerce an object into long format, we create more rows and fewer columns. For a more information about this, please see this case study.

We would like to put toether the different types of percentages of the optimal intake that we just calculated.

To get our data in long format we can use the pivot_longer() function of the dplyr package. We will also show how this would be done with the older version of this function, called gather().

For pivot_longer(), we will list the columns that we want to come together into the longer format using the cols argument. For gather() we would simply list the variables that we wish to consolidate. The names_to argument indicates the name of the variable that will include the character information about the values that we are consolidating, this is the variable names of the columns that we are bringing together. This is equivalent to the key aregument in gather(). The values_to is the name of the column that will contain the values of teh columns we are consolidating. This is equivalent to the value aregument in gather(). We can use contains() of the tidyr package to look at the variables with names that contain "percent" .

We would get an identical output from the methods.

[1] TRUE

Let’s do the same for the age separated data.

Data Exploration

Exploring age collapsed data

Let’s take a look at the percent of consumption. Again we will use the base R summary() function:

  mean_percent    
 Min.   :   0.02  
 1st Qu.:  11.20  
 Median :  34.71  
 Mean   : 187.86  
 3rd Qu.:  73.12  
 Max.   :7693.68  

Wow! Some of the values are nearly zero, suggesting that some people are consuming basically zero percent of what is suggested for optimal health. On the other hand, for some dietary factors people are consuming over 7,000 percent what is suggested!

This is why it is important to look at the direction of consumption that could be harmful. For example if there is a population that consumes large amounts of vegatables this could be a good thing, but if there is a population consuming large amounts of sodium this would be a bad thing.

Let’s take a look to see what dietary factors are at the extremes by arranging the data using the arrange() function of the dplyr package. We can arrange by smallest to largest using the default and we can arrange largest to smallest using the minus sign -.

Observations: 5,880
Variables: 20
$ year_id            <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 201…
$ location_name      <chr> "Costa Rica", "Colombia", "Panama", "Venezuel…
$ rei_id             <dbl> 118, 118, 118, 118, 118, 118, 118, 118, 118, …
$ food               <chr> "sugar-sweetened beverages", "sugar-sweetened…
$ age_group_name     <chr> "All Available Ages", "All Available Ages", "…
$ sex                <chr> "Male", "Male", "Male", "Male", "Male", "Male…
$ parameter          <chr> "continuous", "continuous", "continuous", "co…
$ mean               <dbl> 230.8105, 201.7180, 194.4116, 193.9048, 188.4…
$ upper              <dbl> 247.9342, 216.9260, 208.8040, 208.8702, 203.3…
$ lower              <dbl> 215.5919, 189.4812, 181.7150, 180.7209, 174.5…
$ unit               <chr> "g/day", "g/day", "g/day", "g/day", "g/day", …
$ direction          <chr> "high", "high", "high", "high", "high", "high…
$ lower_optimal      <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
$ optimal            <dbl> 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, …
$ upper_optimal      <dbl> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, …
$ unit_optimal       <chr> "g", "g", "g", "g", "g", "g", "g", "g", "g", …
$ mean_percent       <dbl> 7693.684, 6723.934, 6480.386, 6463.492, 6282.…
$ range_percent      <dbl> 4616.211, 4034.361, 3888.232, 3878.095, 3769.…
$ percent_over_under <dbl> 4516.211, 3934.361, 3788.232, 3778.095, 3669.…
$ opt_achieved       <chr> "No", "No", "No", "No", "No", "No", "No", "No…

Ok, so it looks like sugar-sweetened beverages are really overconsumed in some parts of the world!

Recall from the supplementary table from the article that overconsumption of sugar-sweetened beverages is associated with both Diabetes mellitus type 2 and Ischemic heart disease. This article discusses some of the contrevsy over the potential health risks associated with high consumption of sugar.

It still looks quite bad if we look at the other calculated percentage values.

  mean_percent     range_percent      percent_over_under
 Min.   :   0.02   Min.   :   0.025   Min.   :   0.00   
 1st Qu.:  11.20   1st Qu.:  13.263   1st Qu.:   0.00   
 Median :  34.71   Median :  38.941   Median :  56.82   
 Mean   : 187.86   Mean   : 127.272   Mean   : 122.91   
 3rd Qu.:  73.12   3rd Qu.:  72.414   3rd Qu.:  87.78   
 Max.   :7693.68   Max.   :4616.211   Max.   :4516.21   

So some places are still consuming 4,000 percent more than the upper range of the suggested optimal intake.

Let’s take a look at global levels:

# A tibble: 2 x 20
  year_id location_name rei_id food  age_group_name sex   parameter  mean
    <dbl> <chr>          <dbl> <chr> <chr>          <chr> <chr>     <dbl>
1    2017 Global           118 suga… All Available… Male  continuo…  65.5
2    2017 Global           118 suga… All Available… Fema… continuo…  47.7
# … with 12 more variables: upper <dbl>, lower <dbl>, unit <chr>,
#   direction <chr>, lower_optimal <dbl>, optimal <dbl>,
#   upper_optimal <dbl>, unit_optimal <chr>, mean_percent <dbl>,
#   range_percent <dbl>, percent_over_under <dbl>, opt_achieved <chr>

For those who are less familiar with the metric system where grams are equivalent to milliliters, it may be useful to realize how many fluid ounces the max amount of consumption per day (~248) grams actaully is.

There are 0.35247 ounces in one gram.

[1] 87.38937

Ok, so the top consumers are drinking about 87 fluid ounces per day. Since there are 12 ounces in a single can of soda, this is about 7.25 sodas per day. Globally on average, males are drinking 1.9238988 about sodas worth of sweetened beverages, while females are drinking about 1.4010682.

Let’s take a look at what is underconsumed:

Observations: 5,880
Variables: 20
$ year_id            <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 201…
$ location_name      <chr> "Chad", "Chad", "Mali", "Mali", "Burkina Faso…
$ rei_id             <dbl> 122, 122, 122, 122, 122, 122, 122, 122, 122, …
$ food               <chr> "polyunsaturated fatty acids", "polyunsaturat…
$ age_group_name     <chr> "All Available Ages", "All Available Ages", "…
$ sex                <chr> "Female", "Male", "Female", "Male", "Female",…
$ parameter          <chr> "continuous", "continuous", "continuous", "co…
$ mean               <dbl> 0.002227074, 0.002295916, 0.002301266, 0.0023…
$ upper              <dbl> 0.002383410, 0.002439931, 0.002461209, 0.0025…
$ lower              <dbl> 0.002082132, 0.002161922, 0.002152212, 0.0022…
$ unit               <chr> "%energy/day", "%energy/day", "%energy/day", …
$ direction          <chr> "low", "low", "low", "low", "low", "low", "lo…
$ lower_optimal      <dbl> 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, …
$ optimal            <dbl> 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1…
$ upper_optimal      <dbl> 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 1…
$ unit_optimal       <chr> "%", "%", "%", "%", "%", "%", "%", "%", "%", …
$ mean_percent       <dbl> 0.02024613, 0.02087196, 0.02092060, 0.0215757…
$ range_percent      <dbl> 0.02474527, 0.02551018, 0.02556962, 0.0263703…
$ percent_over_under <dbl> 99.97525, 99.97449, 99.97443, 99.97363, 99.96…
$ opt_achieved       <chr> "No", "No", "No", "No", "No", "No", "No", "No…

On the otherhand, it looks like some places are consuming almost no polyunsaturated fatty acids. These are fats that found in plant-based sources like seeds and nuts. According to an article about polyunsaturated fatty acids and its influence on health:

Coronary heart disease (CHD) is the leading cause of death worldwide … The types of dietary fats consumed play an important role in CHD risk, representing key modifiable risk factors…In particular, higher intakes of trans fat (TFA) and of saturated fat (SFA) replacing ω‐6 (n‐6) polyunsaturated fat (PUFA) are associated with increased CHD… whereas higher intake of PUFA replacing either SFA or carbohydrate is associated with lower risk.

Let’s get an idea about how countries compare in terms of how many of the dietary factors are consumed at the optimal level (the opt_achieved variable).

# A tibble: 2 x 2
  opt_achieved     n
  <chr>        <int>
1 No            4360
2 Yes           1520

Looks like overal, only 34.8623853 of dietary factors for all tested populations were at optimal levels.

Let’s get an idea about how countries compare.

# A tibble: 196 x 3
    opt_achieved location_name                        n
    <chr>        <chr>                            <int>
  1 Yes          Qatar                               13
  2 Yes          Rwanda                              13
  3 Yes          Turkey                              13
  4 Yes          Dominican Republic                  12
  5 Yes          Egypt                               12
  6 Yes          Malawi                              12
  7 Yes          Benin                               11
  8 Yes          Burkina Faso                        11
  9 Yes          Cameroon                            11
 10 Yes          Cuba                                11
 11 Yes          Ethiopia                            11
 12 Yes          Ghana                               11
 13 Yes          Lesotho                             11
 14 Yes          Mali                                11
 15 Yes          Nigeria                             11
 16 Yes          Senegal                             11
 17 Yes          Togo                                11
 18 Yes          Tunisia                             11
 19 Yes          Angola                              10
 20 Yes          Azerbaijan                          10
 21 Yes          Bahrain                             10
 22 Yes          Barbados                            10
 23 Yes          Bermuda                             10
 24 Yes          Chad                                10
 25 Yes          Comoros                             10
 26 Yes          Cote d'Ivoire                       10
 27 Yes          El Salvador                         10
 28 Yes          Guatemala                           10
 29 Yes          Haiti                               10
 30 Yes          India                               10
 31 Yes          Iran                                10
 32 Yes          Kenya                               10
 33 Yes          Lebanon                             10
 34 Yes          Mauritania                          10
 35 Yes          Mauritius                           10
 36 Yes          Morocco                             10
 37 Yes          Mozambique                          10
 38 Yes          Myanmar                             10
 39 Yes          Nepal                               10
 40 Yes          Nicaragua                           10
 41 Yes          Niger                               10
 42 Yes          North Korea                         10
 43 Yes          Sao Tome and Principe               10
 44 Yes          Sierra Leone                        10
 45 Yes          South Sudan                         10
 46 Yes          Tanzania                            10
 47 Yes          Timor-Leste                         10
 48 Yes          Uganda                              10
 49 Yes          United Arab Emirates                10
 50 Yes          Zambia                              10
 51 Yes          Armenia                              9
 52 Yes          Bosnia and Herzegovina               9
 53 Yes          Burundi                              9
 54 Yes          Costa Rica                           9
 55 Yes          Equatorial Guinea                    9
 56 Yes          Eritrea                              9
 57 Yes          Fiji                                 9
 58 Yes          Honduras                             9
 59 Yes          Iraq                                 9
 60 Yes          Kuwait                               9
 61 Yes          Oman                                 9
 62 Yes          Papua New Guinea                     9
 63 Yes          Solomon Islands                      9
 64 Yes          Tajikistan                           9
 65 Yes          Trinidad and Tobago                  9
 66 Yes          Uzbekistan                           9
 67 Yes          Virgin Islands, U.S.                 9
 68 Yes          Afghanistan                          8
 69 Yes          Albania                              8
 70 Yes          Algeria                              8
 71 Yes          American Samoa                       8
 72 Yes          Antigua and Barbuda                  8
 73 Yes          Bangladesh                           8
 74 Yes          Belize                               8
 75 Yes          Bhutan                               8
 76 Yes          Botswana                             8
 77 Yes          Brazil                               8
 78 Yes          Cambodia                             8
 79 Yes          Cape Verde                           8
 80 Yes          Congo                                8
 81 Yes          Democratic Republic of the Congo     8
 82 Yes          Djibouti                             8
 83 Yes          Dominica                             8
 84 Yes          Federated States of Micronesia       8
 85 Yes          Gabon                                8
 86 Yes          Georgia                              8
 87 Yes          Grenada                              8
 88 Yes          Guam                                 8
 89 Yes          Guinea                               8
 90 Yes          Guinea-Bissau                        8
 91 Yes          Guyana                               8
 92 Yes          Indonesia                            8
 93 Yes          Israel                               8
 94 Yes          Jamaica                              8
 95 Yes          Jordan                               8
 96 Yes          Kazakhstan                           8
 97 Yes          Kiribati                             8
 98 Yes          Kyrgyzstan                           8
 99 Yes          Laos                                 8
100 Yes          Liberia                              8
101 Yes          Libya                                8
102 Yes          Macedonia                            8
103 Yes          Madagascar                           8
104 Yes          Malaysia                             8
105 Yes          Maldives                             8
106 Yes          Marshall Islands                     8
107 Yes          Mexico                               8
108 Yes          Moldova                              8
109 Yes          Namibia                              8
110 Yes          Northern Mariana Islands             8
111 Yes          Pakistan                             8
112 Yes          Palestine                            8
113 Yes          Peru                                 8
114 Yes          Philippines                          8
115 Yes          Saint Lucia                          8
116 Yes          Saint Vincent and the Grenadines     8
117 Yes          Samoa                                8
118 Yes          Saudi Arabia                         8
119 Yes          Seychelles                           8
120 Yes          Somalia                              8
121 Yes          Sri Lanka                            8
122 Yes          Sudan                                8
123 Yes          Suriname                             8
124 Yes          Swaziland                            8
125 Yes          Syria                                8
126 Yes          Taiwan                               8
127 Yes          Thailand                             8
128 Yes          The Bahamas                          8
129 Yes          The Gambia                           8
130 Yes          Tonga                                8
131 Yes          Turkmenistan                         8
132 Yes          Vanuatu                              8
133 Yes          Yemen                                8
134 Yes          Zimbabwe                             8
135 Yes          Bolivia                              7
136 Yes          Central African Republic             7
137 Yes          Luxembourg                           7
138 Yes          Montenegro                           7
139 Yes          Panama                               7
140 Yes          Paraguay                             7
141 Yes          Puerto Rico                          7
142 Yes          South Africa                         7
143 Yes          Ukraine                              7
144 Yes          Venezuela                            7
145 Yes          Vietnam                              7
146 Yes          Canada                               6
147 Yes          Colombia                             6
148 Yes          Greece                               6
149 Yes          Japan                                6
150 Yes          Malta                                6
151 Yes          Mongolia                             6
152 Yes          Portugal                             6
153 Yes          Romania                              6
154 Yes          Serbia                               6
155 Yes          Argentina                            5
156 Yes          Belarus                              5
157 Yes          Bulgaria                             5
158 Yes          Croatia                              5
159 Yes          Ecuador                              5
160 Yes          Finland                              5
161 Yes          Global                               5
162 Yes          Iceland                              5
163 Yes          Netherlands                          5
164 Yes          Russian Federation                   5
165 Yes          Sweden                               5
166 Yes          Andorra                              4
167 Yes          Australia                            4
168 Yes          Austria                              4
169 Yes          Belgium                              4
170 Yes          Brunei                               4
171 Yes          Chile                                4
172 Yes          China                                4
173 Yes          Cyprus                               4
174 Yes          Denmark                              4
175 Yes          Estonia                              4
176 Yes          France                               4
177 Yes          Germany                              4
178 Yes          Ireland                              4
179 Yes          Italy                                4
180 Yes          Latvia                               4
181 Yes          Lithuania                            4
182 Yes          New Zealand                          4
183 Yes          Norway                               4
184 Yes          Poland                               4
185 Yes          Singapore                            4
186 Yes          South Korea                          4
187 Yes          Spain                                4
188 Yes          Switzerland                          4
189 Yes          United Kingdom                       4
190 Yes          Uruguay                              4
191 Yes          Czech Republic                       3
192 Yes          Greenland                            3
193 Yes          Hungary                              3
194 Yes          Slovakia                             3
195 Yes          Slovenia                             3
196 Yes          United States                        3

Looks as though on average the populations (both male and female separately) in Qatar, Rwanda, and Turkey consumped the optimal level of intake for the largest number of dietary factors (13 out of 30 (for the 15 dietary factors for males and females)).

In contrast, the Czech Republic, Greenland, Hungary, Slovakia, Slovenia, and the United States had the poorest consumption rates (27 out of 30 were not at optimal levels).

# A tibble: 196 x 3
    opt_achieved location_name                        n
    <chr>        <chr>                            <int>
  1 No           Czech Republic                      27
  2 No           Greenland                           27
  3 No           Hungary                             27
  4 No           Slovakia                            27
  5 No           Slovenia                            27
  6 No           United States                       27
  7 No           Andorra                             26
  8 No           Australia                           26
  9 No           Austria                             26
 10 No           Belgium                             26
 11 No           Brunei                              26
 12 No           Chile                               26
 13 No           China                               26
 14 No           Cyprus                              26
 15 No           Denmark                             26
 16 No           Estonia                             26
 17 No           France                              26
 18 No           Germany                             26
 19 No           Ireland                             26
 20 No           Italy                               26
 21 No           Latvia                              26
 22 No           Lithuania                           26
 23 No           New Zealand                         26
 24 No           Norway                              26
 25 No           Poland                              26
 26 No           Singapore                           26
 27 No           South Korea                         26
 28 No           Spain                               26
 29 No           Switzerland                         26
 30 No           United Kingdom                      26
 31 No           Uruguay                             26
 32 No           Argentina                           25
 33 No           Belarus                             25
 34 No           Bulgaria                            25
 35 No           Croatia                             25
 36 No           Ecuador                             25
 37 No           Finland                             25
 38 No           Global                              25
 39 No           Iceland                             25
 40 No           Netherlands                         25
 41 No           Russian Federation                  25
 42 No           Sweden                              25
 43 No           Canada                              24
 44 No           Colombia                            24
 45 No           Greece                              24
 46 No           Japan                               24
 47 No           Malta                               24
 48 No           Mongolia                            24
 49 No           Portugal                            24
 50 No           Romania                             24
 51 No           Serbia                              24
 52 No           Bolivia                             23
 53 No           Central African Republic            23
 54 No           Luxembourg                          23
 55 No           Montenegro                          23
 56 No           Panama                              23
 57 No           Paraguay                            23
 58 No           Puerto Rico                         23
 59 No           South Africa                        23
 60 No           Ukraine                             23
 61 No           Venezuela                           23
 62 No           Vietnam                             23
 63 No           Afghanistan                         22
 64 No           Albania                             22
 65 No           Algeria                             22
 66 No           American Samoa                      22
 67 No           Antigua and Barbuda                 22
 68 No           Bangladesh                          22
 69 No           Belize                              22
 70 No           Bhutan                              22
 71 No           Botswana                            22
 72 No           Brazil                              22
 73 No           Cambodia                            22
 74 No           Cape Verde                          22
 75 No           Congo                               22
 76 No           Democratic Republic of the Congo    22
 77 No           Djibouti                            22
 78 No           Dominica                            22
 79 No           Federated States of Micronesia      22
 80 No           Gabon                               22
 81 No           Georgia                             22
 82 No           Grenada                             22
 83 No           Guam                                22
 84 No           Guinea                              22
 85 No           Guinea-Bissau                       22
 86 No           Guyana                              22
 87 No           Indonesia                           22
 88 No           Israel                              22
 89 No           Jamaica                             22
 90 No           Jordan                              22
 91 No           Kazakhstan                          22
 92 No           Kiribati                            22
 93 No           Kyrgyzstan                          22
 94 No           Laos                                22
 95 No           Liberia                             22
 96 No           Libya                               22
 97 No           Macedonia                           22
 98 No           Madagascar                          22
 99 No           Malaysia                            22
100 No           Maldives                            22
101 No           Marshall Islands                    22
102 No           Mexico                              22
103 No           Moldova                             22
104 No           Namibia                             22
105 No           Northern Mariana Islands            22
106 No           Pakistan                            22
107 No           Palestine                           22
108 No           Peru                                22
109 No           Philippines                         22
110 No           Saint Lucia                         22
111 No           Saint Vincent and the Grenadines    22
112 No           Samoa                               22
113 No           Saudi Arabia                        22
114 No           Seychelles                          22
115 No           Somalia                             22
116 No           Sri Lanka                           22
117 No           Sudan                               22
118 No           Suriname                            22
119 No           Swaziland                           22
120 No           Syria                               22
121 No           Taiwan                              22
122 No           Thailand                            22
123 No           The Bahamas                         22
124 No           The Gambia                          22
125 No           Tonga                               22
126 No           Turkmenistan                        22
127 No           Vanuatu                             22
128 No           Yemen                               22
129 No           Zimbabwe                            22
130 No           Armenia                             21
131 No           Bosnia and Herzegovina              21
132 No           Burundi                             21
133 No           Costa Rica                          21
134 No           Equatorial Guinea                   21
135 No           Eritrea                             21
136 No           Fiji                                21
137 No           Honduras                            21
138 No           Iraq                                21
139 No           Kuwait                              21
140 No           Oman                                21
141 No           Papua New Guinea                    21
142 No           Solomon Islands                     21
143 No           Tajikistan                          21
144 No           Trinidad and Tobago                 21
145 No           Uzbekistan                          21
146 No           Virgin Islands, U.S.                21
147 No           Angola                              20
148 No           Azerbaijan                          20
149 No           Bahrain                             20
150 No           Barbados                            20
151 No           Bermuda                             20
152 No           Chad                                20
153 No           Comoros                             20
154 No           Cote d'Ivoire                       20
155 No           El Salvador                         20
156 No           Guatemala                           20
157 No           Haiti                               20
158 No           India                               20
159 No           Iran                                20
160 No           Kenya                               20
161 No           Lebanon                             20
162 No           Mauritania                          20
163 No           Mauritius                           20
164 No           Morocco                             20
165 No           Mozambique                          20
166 No           Myanmar                             20
167 No           Nepal                               20
168 No           Nicaragua                           20
169 No           Niger                               20
170 No           North Korea                         20
171 No           Sao Tome and Principe               20
172 No           Sierra Leone                        20
173 No           South Sudan                         20
174 No           Tanzania                            20
175 No           Timor-Leste                         20
176 No           Uganda                              20
177 No           United Arab Emirates                20
178 No           Zambia                              20
179 No           Benin                               19
180 No           Burkina Faso                        19
181 No           Cameroon                            19
182 No           Cuba                                19
183 No           Ethiopia                            19
184 No           Ghana                               19
185 No           Lesotho                             19
186 No           Mali                                19
187 No           Nigeria                             19
188 No           Senegal                             19
189 No           Togo                                19
190 No           Tunisia                             19
191 No           Dominican Republic                  18
192 No           Egypt                               18
193 No           Malawi                              18
194 No           Qatar                               17
195 No           Rwanda                              17
196 No           Turkey                              17

Let’s look at the raw US data:

Observations: 30
Variables: 20
$ year_id            <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 201…
$ location_name      <chr> "United States", "United States", "United Sta…
$ rei_id             <dbl> 111, 111, 112, 112, 113, 113, 114, 114, 115, …
$ food               <chr> "fruits", "fruits", "vegetables", "vegetables…
$ age_group_name     <chr> "All Available Ages", "All Available Ages", "…
$ sex                <chr> "Male", "Female", "Male", "Female", "Male", "…
$ parameter          <chr> "continuous", "continuous", "continuous", "co…
$ mean               <dbl> 114.24773940, 129.11513300, 208.93230110, 192…
$ upper              <dbl> 121.37292480, 136.94611510, 217.80223830, 200…
$ lower              <dbl> 107.89222320, 122.33941970, 200.05582000, 184…
$ unit               <chr> "g/day", "g/day", "g/day", "g/day", "g/day", …
$ direction          <chr> "low", "low", "low", "low", "low", "low", "lo…
$ lower_optimal      <dbl> 200.0, 200.0, 290.0, 290.0, 100.0, 100.0, 16.…
$ optimal            <dbl> 250.00, 250.00, 360.00, 360.00, 125.00, 125.0…
$ upper_optimal      <dbl> 300.0, 300.0, 430.0, 430.0, 150.0, 150.0, 25.…
$ unit_optimal       <chr> "g", "g", "g", "g", "g", "g", "g", "g", "g", …
$ mean_percent       <dbl> 45.699096, 51.646053, 58.036750, 53.515649, 2…
$ range_percent      <dbl> 57.123870, 64.557566, 72.045621, 66.433220, 2…
$ percent_over_under <dbl> 42.876130, 35.442434, 27.954379, 33.566780, 7…
$ opt_achieved       <chr> "No", "No", "No", "No", "No", "No", "No", "No…

Let’s see how males and females compare for achieving the optimal intake:

# A tibble: 4 x 3
  sex    opt_achieved     n
  <chr>  <chr>        <int>
1 Female No            2171
2 Female Yes            769
3 Male   No            2189
4 Male   Yes            751

Looks pretty similar, but it may be a bit better for females. We will evaluate this further.

Here is a way we can visualise this with the ggplot2 package. The ggplot2 package creates plots by using layers. Notice in the following code how there is a plus sign between the ggplot() function and the geom_histogram() function. With ggplot2 we select what data we would like to plot using the first function (ggplot()) and then we add on additional layers of complexity (these layers can even involve different data). The aes() argument specifies what aspects of the data will be plotted where. the geom_* function specifies what type of plot to create (e.g. geom_histogram() create a histogram).

We will see later how we can add many layers to plots with ggplot2. For additional information on using ggplot2, see this case study.

Continuing with ggplot2 we will now create a different plot - this time we will create a series of boxplots. We will use the facet_wrap() function of ggplot2 to allow us to create many different plots simultaneously. In this case we can look at boxplots for the different dietary factors colored by sex. The scales argument when set to "free" means that each of the sequentual plot created by the facet can have a differnt scale for the y axis, otherwise, by default they are constrained to the same scale.

If we just look at differences by sex for the specific dietary factors, males appear to potentially consume more of many of the factors, including possibly more sodium, fiber, calcium, red meat, and sugar-sweetened beverages than females. Females may consume more fruit.

Exploring the data separated by age

Now we will take a look at the data that is separated by age groups.

First, recall that we have 15 different age groups starting from age 25 to 95 plus.

# A tibble: 15 x 2
   age_group_name     n
   <chr>          <int>
 1 25 to 29        5880
 2 30 to 34        5880
 3 35 to 39        5880
 4 40 to 44        5880
 5 45 to 49        5880
 6 50 to 54        5880
 7 55 to 59        5880
 8 60 to 64        5880
 9 65 to 69        5880
10 70 to 74        5880
11 75 to 79        5880
12 80 to 84        5880
13 85 to 89        5880
14 90 to 94        5880
15 95 plus         5880

We can see from these plots that there appears to be age differences and gender differences for some of the different dietary factors. We will work to create clearer figures later on. However these figures have given us a better sense of the data that we are working with.

Data Analysis

Recall what our main question were:

Our main questions are:

  1. What are the global trends for potentially harmful diets?
  2. How do males and females compare?
  3. How do different age groups compare for these dietary factors?
  4. How do different countries compare? In particular, how does the US compare to other contries in terms of diet trends?

We have some general sense about global trends for the risk-associated dietary factors, however we want to know more.

We are interested in how much the 2 genders differ, how much the 15 different age groups differ, and how the 195 countries compare.

In order to make inference about these comparisons, it is helpful to perform statistical tests. These tests can help us to determine the strength of the association between sex, age group and country identiy with relative consumption of the dietary factors of interest. One way to look at the strength of assocation is to use a statistical method called regression.

We may have learned that we can compare two groups using a \(t\)-test. For more information on the \(t\)-test see this case study.

Perhaps you have heard about the ANOVA test which can be useful for comparing more than two groups. ANOVA stands for “ANalysis Of VAriance”.

It turns out that both the \(t\)-test and the ANOVA, are equivalent to specialized types of regression. We will use each of these tests to investigate patterns of consumption for dietary factors that contribute to health risk and we will look at how we can obtain equivalent results with different tests.

Regression

So what is regression? How can we use regression to compare our groups of interest and look at the relationship between group identiy and consumption of dietary factors associated with health risk?

The statistical version of the term was coined in 1877 in this article about the relationship between heriditary traits and population averages. the author particularly focused on height and kinship or relatedness. The word in general means to go back to a simpler mode. It was noticed that individuals with parents who had an extreme trait, such as height, tended to have a height more similar to the average of the population rather than the extreme height of their parents. For example if parents were very tall, their children were likely to be a bit shorter than their parents and therefore closer to the population average. Thus the children regressed towards the mean or in the author’s words the offspring showed:

“a regression towards mediocrity”

See here for more information about this history.

When we think about this from a statistical standpoint, regression allows us to estimate or regress relationships between variables to a “simple” model. We do this by estimating the mean of an outcome. This can be useful for predicting future values of the outcome based on the approximation of the real relationship between the varaibles within the model.

Using the ordinary least squares method we can identify a line that best fits the data by minimizing the sum of the squared distances between each point and the line.

Fitting a line to the data like this allows us to create a formula for the line using an intercept and a slope, so that we can then estimate mean values of \(Y\) (dependent/outcome variable) given known values of \(X\) (independent/predictor/covariate/explanatory variable(s)). People will also say that we are "regressing \(Y\) on \(X\).

You may have seen the formula for a line written like this:

\[Y = mX + b\]

or

\[Y = aX + b\]

In this case \(m\) or \(a\) is the slope of the line and \(b\) is a constant and represents the intercept or the point where the y axis is crossed by the line, when \(x = 0\).

We can also write this model like this:

\[Y = \beta_{1}X +\beta_{0}\]

Now \(\beta_{1}\) called Beta one is our slope notation and \(B0\) Beta not is our intercept notation.

Importantly the slope (\(m\) or \(a\) or \(\beta_{1}\)) gives us a measure of the strength of the influence of the independent variable(s)(\(X_{i}\)) on the dependent variable (\(Y\)).

Check out this interactive explanation of how the ordinary least squares method works.

Here is an image of what we are saying about the ordinary least squares regression to fit a line to data:

[source]

In some cases we can fit a line perfectly and all points will lie on the line with no distance to the line:

In this case, the slope or \(\beta_{1}\) is 1 and the intercept is \(\beta_{0}\) 10. We can see that if \(X\) were 50, \(Y\) would be approximately 60. This is very unusal in statistical analysis however, as often the relationship between variables is more complicated.

In other cases there will be greater distances between the line and the points. Like this regression:

In this case, beacuse there is some verticle distance between the line and the data points, there is a bit of what is called error in the model. The formula for the relationship between \(X\) and \(Y\) does not perfectly describe the data. The distance between the line and each data point is what we call a residual. Our least squares method finds the line with the minimized value of the sum of the residual values.

This concept has been extended to allow for comparisons of different types of outcomes (the ys), to involve various numbers of covariates (indpendent variables - the xs), and to allow for different shapes of lines. For a guide on how to perform regressions in R see here.

In R we indicate a linear model like this:

Here our response/otcome variable is on the left of the ~ while our covariates or explanatory variables are on the right of the ~.

So let’s get back to our data…What types of outcomes do we have?

Our outcomes (\(Y\)):

We can evaluate the raw consumption or the percent of optimal consumption values that we calculated. These outcomes would all be what we call continuous beause our values can take on any numeric value within the range of possible values. Binary outcomes in contrast, have only two possible categorical values. We can also evaluate our binary outcome of if the optimal level of consumption was achieved or not.

Continuous outcomes can be evaluated with various types of linear regressions, while binary outcomes can be evaluated with what is called logistic regression. See here for a guide on different types of regression methods.

We have both continuous outcomes of raw consumption rates or percentages of consumption relatative to the optimal guideline amounts as well as binary outcomes of “yes” or “no” about if a population achieved the optimal amount of consumption.

Our covariates (\(X_{i}\)):

We have data about age group, sex, and region information for all of our outcomes.

Again we are intereseted in comparing the sexes, the different age groups, and the different countries for their consumption of the different dietary factors. We can apply regression to determine if there is any influence of these group identities on the dietary consumption outcomes.

Before we get started, let’s remove the global values from our data and set them aside, as this is really a composite of all the country values.

\(t\)-test and linear regression

Let’s focus on the dietary factors that appeared to potentially have a difference between genders based on our figure in our exploratory analysis.

“If we just look at differences by sex for the specific dietary factors, males appear to potentially consume more of many of the factors, including possibly more sodium, fiber, calcium, red meat, and sugar-sweetened beverages than females. Females may consume more fruit.”

First let’s take a look at red meat.

We can compare the red meat consumption of males and females around the world using the well known \(t\)-test using the t.test() function and a linear regression model using the lm() function (both are included in stats package that is installed with R) and we will get the same results. See here for additional explanation about why that is the case. Here and here are also great sources about how many commonly known statistical tests are specialized forms of regression.

Before we get started, let’s think about the assumptions of both tests.

\(t\)-test assumptions:

  1. Normality of the data for both groups (this is not as much of an issue if the number of observations is relatively large total n>30 - which is indeed the case for us!)
  2. Equal variance between the two groups (make sure you do the correct test if the data is not normal)
  3. Balanced sample sizes of the two groups (got that!)
  4. Independent observations (or independent paired observations - got that too!)

We can evaluate if our data is normally distributed by plotting the distribution and by creating Q-Q plots.

If our data is not normally distributed, we can consider these options:

  1. We can still perform a t-test if our n is large
  2. We can transform the data before performing a t-test
  3. We can use a nonparametric test (Wilcoxon signed rank test, the Wilcoxon rank sum test, and the Two-sample Kolmogorov-Smirnov (KS) test)
  4. We can perform a t-test with resampling methods (which should be especially considered when the groups are imbalanced)

See this case study for more information on \(t\)-test assumptions.

Linear regression assumptions

L (linear) - There is a linear relationship between the variables. I (independent) - The samples are independent from one another. N (normal) - The residuals are normally distributed. E (equal variances) - The variance of the groups is similar.

Distributions

In order to apply a statistical test to compare the means, one of the first things to do is to explore the frequency of the different observed values. One way to summarize the frequency of different observed values is the frequency distribution, which can be shown in a table or a plot. See here for more information about distributions.

We will use the geom_histogram() of the ggplot2package to create a histogram to evaluate the frequency distributions of our data. The facet_wrap() function of the ggplot2 package allows us to look at different parts of our data in separate plots.

Now we add another dimension to our facet with the plus sign. Now it becomes very useful that we reformmated our data to the long format, as it makes it easy to facet across the different percentages that we calculated. We can specify that we want to have different y axis scales using the scales argument as: scales = "free".

Looks like our data is right skewed.

We can transform our data to make it more normally distrubuted. When data is highly right skewed, a log transformation is often helpful.

Let’s take a look a the log of our percent of optimal consumption values.

Ok, so we can get our data to look fairly normal, which is good for our \(t\)-test assumptions. The other thing we need to check is if the variance in red meat consumption is similar between the two genders. We can use the var.test() of the stats package using the log normalized data, as this data is fairly normally distributed. We can use the mood.test on the raw data which is skewed.


    Mood two-sample test of scale

data:  pull(filter(diet_and_guidelines, food == "red meat"), mean_percent) and pull(filter(diet_and_guidelines, food == "red meat"), sex)
Z = NaN, p-value = NA
alternative hypothesis: two.sided

    F test to compare two variances

data:  log10(pull(filter(diet_and_guidelines, food == "red meat"), mean_percent)) by pull(filter(diet_and_guidelines, food == "red meat"), sex)
F = 0.96369, num df = 194, denom df = 194, p-value = 0.797
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
 0.7266925 1.2779719
sample estimates:
ratio of variances 
          0.963687 

The p value >.05 for both tests, thus we can conclude that there is not enough evidence to reject the null (no difference in the spread of the distributions), thus we conclude that variance is roughly equal. Great… so we are in pretty good shape for both the \(t\)-test and the linear regression.

So now we can comparing the consumption of red meat by both genders using both a \(t\)-test and a linear regression:


Call:
lm(formula = log10(mean_percent) ~ sex, data = .)

Residuals:
    Min      1Q  Median      3Q     Max 
-1.0238 -0.2484  0.0052  0.3127  0.6170 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1.79887    0.02451  73.382  < 2e-16 ***
sexMale      0.18439    0.03467   5.319 1.77e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.3423 on 388 degrees of freedom
Multiple R-squared:  0.06795,   Adjusted R-squared:  0.06555 
F-statistic: 28.29 on 1 and 388 DF,  p-value: 1.77e-07

    Two Sample t-test

data:  log10(mean_percent) by sex
t = -5.3187, df = 388, p-value = 1.77e-07
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.2525474 -0.1162266
sample estimates:
mean in group Female   mean in group Male 
            1.798872             1.983259 

Notice how the \(t\) value and the p-value are the same! (Well alomost, the \(t\) value is negative in the t.test() output because the female group is being used as reference group, while the male group is being used as the reference group in lm()). We can fix this using the fct_inorder() function of the forcats package which is all about factors. This function allows us to order the factor by what appears first. In this case “male” appears first, so now our output will match that of the lm() function.


Call:
lm(formula = log10(mean_percent) ~ sex, data = .)

Residuals:
    Min      1Q  Median      3Q     Max 
-1.0238 -0.2484  0.0052  0.3127  0.6170 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1.79887    0.02451  73.382  < 2e-16 ***
sexMale      0.18439    0.03467   5.319 1.77e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.3423 on 388 degrees of freedom
Multiple R-squared:  0.06795,   Adjusted R-squared:  0.06555 
F-statistic: 28.29 on 1 and 388 DF,  p-value: 1.77e-07

    Two Sample t-test

data:  log10(mean_percent) by sex
t = 5.3187, df = 388, p-value = 1.77e-07
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 0.1162266 0.2525474
sample estimates:
  mean in group Male mean in group Female 
            1.983259             1.798872 

Now they match. Notice that the degrees of freedom also match, both results show 388 degrees of freedom. We are estimating 2 parameters for the linear model the two \(\beta\) coefficients, (the slope and intercept), and for the \(t\)-test we are estimating the means of two groups (males and females). Overall we have two samples (male and female) for each of the 195 countries.

Thus, the overal sample number is: \(n = 195*2 = 390\)

\[df = n - # parameters estimating\] Thus the degrees of freedom can be calculated as: \(df = 390 -2 = 388\)

In the lm() output, the Beta not (\(\beta_{0}\)) which can be interpreted as the intercept or the mean value when sex is not male (so in this case when sex is female) has the same value as the calculated mean of in the t.test() output. The Beta one (\(\beta_{1}\)) can be interpreted as the slope of the regression line or the difference bewteen the means of the two groups. We can also think of this as as the change in \(Y\) with one unit change in \(X\).

If we subtract the means calculated in the t.test() output, we get the value of \(\beta_{1}\) (the slope or the sexMale estimate) of the lm() output!

Mean of males - Mean of females \(1.983259 - 1.798872 =0.184387\)

Cool!

For more information about the output of lm() see here.

Let’s plot the data to see what is happening:

We can see that the slope of the linear model is equivalent to the difference bewteen the mean of the two groups, as the linear model line is parallel to the line drawn between the two means.

Also, since we have female and male values each from the same countries, our data is what we called paired. Thus the values from the same country could be related to one another becuase of cultural difference in diet, thus the assumption of the unpaired \(t\)-test that the samples are independent is violated. Therefore, we need to model our data in a way that accounts for this. First we will use the pivot_wider() function of the tidyr package to get our data in a format that is easier to use for this purpose. To use this function we specify the values that we want to separate into more variables using the values_from argument and we use the names_from argument to specify how we want to separate these other variables. In this case we will make a male and female version of all the other variables specified.

Observations: 2,925
Variables: 27
$ year_id                   <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 20…
$ location_name             <chr> "China", "China", "China", "China", "C…
$ rei_id                    <dbl> 111, 112, 113, 114, 115, 116, 117, 118…
$ food                      <chr> "fruits", "vegetables", "whole grains"…
$ age_group_name            <chr> "All Available Ages", "All Available A…
$ parameter                 <chr> "continuous", "continuous", "continuou…
$ unit                      <chr> "g/day", "g/day", "g/day", "g/day", "g…
$ direction                 <chr> "low", "low", "low", "low", "low", "hi…
$ lower_optimal             <dbl> 200.0, 290.0, 100.0, 16.0, 350.0, 18.0…
$ optimal                   <dbl> 250.00, 360.00, 125.00, 21.00, 435.00,…
$ upper_optimal             <dbl> 300.0, 430.0, 150.0, 25.0, 520.0, 27.0…
$ unit_optimal              <chr> "g", "g", "g", "g", "g", "g", "g", "g"…
$ food_to_plot              <chr> "fruits", "vegetables", "whole\ngrains…
$ mean_percent_Male         <dbl> 30.1276714, 69.9780163, 20.5969990, 9.…
$ mean_percent_Female       <dbl> 34.3698972, 65.4711643, 19.2030299, 8.…
$ range_percent_Male        <dbl> 37.6595893, 86.8692617, 25.7462488, 12…
$ range_percent_Female      <dbl> 42.9623715, 81.2745488, 24.0037874, 11…
$ percent_over_under_Male   <dbl> 62.34041, 13.13074, 74.25375, 87.46243…
$ percent_over_under_Female <dbl> 57.03763, 18.72545, 75.99621, 88.20590…
$ mean_Male                 <dbl> 7.531918e+01, 2.519209e+02, 2.574625e+…
$ mean_Female               <dbl> 8.592474e+01, 2.356962e+02, 2.400379e+…
$ upper_Male                <dbl> 8.658295e+01, 2.946774e+02, 2.723223e+…
$ upper_Female              <dbl> 9.759191e+01, 2.720864e+02, 2.541951e+…
$ lower_Male                <dbl> 6.543868e+01, 2.153508e+02, 2.426562e+…
$ lower_Female              <dbl> 7.531231e+01, 2.033138e+02, 2.262773e+…
$ opt_achieved_Male         <chr> "No", "No", "No", "No", "No", "No", "Y…
$ opt_achieved_Female       <chr> "No", "No", "No", "No", "No", "No", "Y…

Paired \(t\)-test and linear model with two fixed effects

Now will perform the paired versions of our tests. This is very easy to do with the t.test() function, by simply using the paired argument and setting it equal to TRUE.

The paired version of the linear model is a bit more complex. In this case we will add another term in our model to evaluate the influence of sex on mean_percent consumption while keeping the country identity fixed or constant, or in other words controlling / adjusting for country. We can use the + to add this additional term. Now that we have multiple covariate / explanotory variable terms, we would call this a multiple linear regression.

So now our model in words will be:

Mean relative consumption of red meat is dependent on sex and country.

Then the coefficient for sex will be different from what we had in our previous lm() model, as it will be calculated while keeping location_name or the country where the consumption value was obtained fixed, or in other words “controlling for location_name.” This will also result in output for each of the countries. The coefficients here represent the average consumption value for each country while accounting for sex.


Call:
lm(formula = log10(pull(filter(diet_and_guidelines, food == "red meat"), 
    mean_percent)) ~ pull(filter(diet_and_guidelines, food == 
    "red meat"), sex) + pull(filter(diet_and_guidelines, food == 
    "red meat"), location_name))

Residuals:
      Min        1Q    Median        3Q       Max 
-0.031341 -0.003897  0.000000  0.003897  0.031341 

Coefficients:
                                                                                                      Estimate
(Intercept)                                                                                           1.537017
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male                                        0.184387
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Albania                           0.438021
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Algeria                           0.045488
pull(filter(diet_and_guidelines, food == "red meat"), location_name)American Samoa                    0.467181
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Andorra                           0.748631
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Angola                            0.250455
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda               0.299310
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Argentina                         0.824071
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Armenia                           0.394447
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Australia                         0.814642
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Austria                           0.870921
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                        0.293968
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bahrain                           0.289155
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bangladesh                       -0.611390
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Barbados                          0.310247
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belarus                           0.687041
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belgium                           0.676956
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belize                            0.176578
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Benin                            -0.326705
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bermuda                           0.424542
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bhutan                           -0.120195
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bolivia                           0.493009
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina            0.170649
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Botswana                          0.133756
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brazil                            0.740470
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brunei                            0.221789
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bulgaria                          0.680417
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                      0.092972
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burundi                          -0.196961
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cambodia                          0.110614
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cameroon                         -0.055387
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Canada                            0.667331
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cape Verde                        0.394975
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Central African Republic          0.369231
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chad                              0.043477
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chile                             0.670126
pull(filter(diet_and_guidelines, food == "red meat"), location_name)China                             0.634103
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Colombia                          0.360716
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Comoros                          -0.115892
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Congo                            -0.257950
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Costa Rica                        0.379751
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                    -0.387071
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Croatia                           0.581435
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cuba                              0.347647
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cyprus                            0.600760
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Czech Republic                    0.647519
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo -0.140305
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Denmark                           0.662793
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Djibouti                          0.204672
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominica                          0.196880
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominican Republic                0.279081
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ecuador                           0.516439
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Egypt                             0.138031
pull(filter(diet_and_guidelines, food == "red meat"), location_name)El Salvador                       0.043217
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                 0.415090
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Eritrea                          -0.141927
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Estonia                           0.541948
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ethiopia                         -0.173354
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia    0.209379
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Fiji                              0.297535
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Finland                           0.625494
pull(filter(diet_and_guidelines, food == "red meat"), location_name)France                            0.700810
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Gabon                             0.187008
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Georgia                           0.228131
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Germany                           0.703028
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ghana                            -0.346773
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greece                            0.667048
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greenland                         0.768537
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Grenada                           0.213445
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guam                              0.577515
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guatemala                         0.009005
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea                           -0.194870
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                     0.133387
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guyana                           -0.216393
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Haiti                            -0.051033
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Honduras                          0.117781
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Hungary                           0.610661
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iceland                           0.659366
pull(filter(diet_and_guidelines, food == "red meat"), location_name)India                            -0.650568
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Indonesia                        -0.219020
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iran                             -0.045613
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iraq                             -0.318520
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ireland                           0.800964
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Israel                            0.483992
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Italy                             0.663507
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jamaica                          -0.033539
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Japan                             0.374311
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jordan                            0.109734
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                        0.657682
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kenya                             0.104881
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kiribati                          0.130670
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kuwait                            0.365667
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                        0.424414
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Laos                              0.224672
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Latvia                            0.573087
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lebanon                           0.330736
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lesotho                           0.078852
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Liberia                          -0.380804
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Libya                             0.101999
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lithuania                         0.653012
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Luxembourg                        0.801064
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Macedonia                         0.315642
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Madagascar                        0.010171
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malawi                           -0.240867
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malaysia                          0.126939
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Maldives                         -0.131439
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mali                              0.252462
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malta                             0.654370
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                  0.242041
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritania                        0.253405
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritius                         0.084586
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mexico                            0.493796
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Moldova                           0.248523
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mongolia                          0.802313
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Montenegro                        0.695318
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Morocco                           0.046481
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mozambique                       -0.146113
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Myanmar                           0.161358
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Namibia                           0.271516
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nepal                            -0.003694
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Netherlands                       0.689104
pull(filter(diet_and_guidelines, food == "red meat"), location_name)New Zealand                       0.792965
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nicaragua                        -0.108988
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Niger                             0.191332
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nigeria                          -0.169992
pull(filter(diet_and_guidelines, food == "red meat"), location_name)North Korea                      -0.246185
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands          0.435022
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Norway                            0.663406
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Oman                              0.377107
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Pakistan                          0.014624
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Palestine                        -0.002820
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Panama                            0.477302
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                  0.177936
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Paraguay                          0.601524
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Peru                             -0.037011
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Philippines                       0.344310
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Poland                            0.687177
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Portugal                          0.733722
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                       0.412028
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Qatar                             0.429955
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Romania                           0.652514
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Russian Federation                0.535982
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Rwanda                           -0.277812
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                       0.212165
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines  0.196704
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Samoa                             0.267956
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe            -0.047627
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                      0.057527
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Senegal                          -0.072896
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Serbia                            0.508400
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Seychelles                        0.301701
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                     -0.522458
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Singapore                         0.582594
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovakia                          0.627148
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovenia                          0.679024
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                  -0.010315
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Somalia                          -0.256388
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Africa                      0.435449
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Korea                       0.592893
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Sudan                       0.015340
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Spain                             0.678441
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                        -0.749966
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sudan                            -0.050768
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Suriname                          0.176747
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Swaziland                         0.301692
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sweden                            0.692026
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Switzerland                       0.701932
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Syria                            -0.011904
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Taiwan                            0.677543
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tajikistan                        0.015453
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tanzania                         -0.129507
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Thailand                          0.164882
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Bahamas                       0.577812
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Gambia                       -0.389047
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                       0.060600
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Togo                             -0.308629
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tonga                             0.289031
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago               0.160447
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tunisia                          -0.005090
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkey                            0.050119
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                      0.722890
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uganda                            0.015166
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ukraine                           0.372418
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates              0.283428
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Kingdom                    0.556010
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United States                     0.708984
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uruguay                           0.632295
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                        0.458726
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vanuatu                           0.191061
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Venezuela                         0.439508
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vietnam                           0.494979
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.              0.438211
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Yemen                            -0.126839
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zambia                           -0.104306
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                          0.046567
                                                                                                     Std. Error
(Intercept)                                                                                            0.006860
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male                                         0.000980
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Albania                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Algeria                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)American Samoa                     0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Andorra                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Angola                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda                0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Argentina                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Armenia                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Australia                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Austria                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bahrain                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bangladesh                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Barbados                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belarus                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belgium                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belize                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Benin                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bermuda                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bhutan                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bolivia                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Botswana                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brazil                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brunei                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bulgaria                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                       0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burundi                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cambodia                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cameroon                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Canada                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cape Verde                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Central African Republic           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chad                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chile                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)China                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Colombia                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Comoros                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Congo                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Costa Rica                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                      0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Croatia                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cuba                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cyprus                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Czech Republic                     0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo   0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Denmark                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Djibouti                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominica                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominican Republic                 0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ecuador                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Egypt                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)El Salvador                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                  0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Eritrea                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Estonia                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ethiopia                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia     0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Fiji                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Finland                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)France                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Gabon                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Georgia                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Germany                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ghana                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greece                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greenland                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Grenada                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guam                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guatemala                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                      0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guyana                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Haiti                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Honduras                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Hungary                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iceland                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)India                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Indonesia                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iran                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iraq                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ireland                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Israel                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Italy                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jamaica                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Japan                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jordan                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kenya                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kiribati                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kuwait                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Laos                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Latvia                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lebanon                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lesotho                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Liberia                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Libya                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lithuania                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Luxembourg                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Macedonia                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Madagascar                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malawi                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malaysia                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Maldives                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mali                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malta                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                   0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritania                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritius                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mexico                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Moldova                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mongolia                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Montenegro                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Morocco                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mozambique                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Myanmar                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Namibia                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nepal                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Netherlands                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)New Zealand                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nicaragua                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Niger                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nigeria                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)North Korea                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Norway                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Oman                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Pakistan                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Palestine                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Panama                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                   0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Paraguay                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Peru                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Philippines                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Poland                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Portugal                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Qatar                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Romania                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Russian Federation                 0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Rwanda                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines   0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Samoa                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                       0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Senegal                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Serbia                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Seychelles                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                       0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Singapore                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovakia                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovenia                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                    0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Somalia                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Africa                       0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Korea                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Sudan                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Spain                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sudan                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Suriname                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Swaziland                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sweden                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Switzerland                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Syria                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Taiwan                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tajikistan                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tanzania                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Thailand                           0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Bahamas                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Gambia                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                        0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Togo                               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tonga                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago                0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tunisia                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkey                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                       0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uganda                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ukraine                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Kingdom                     0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United States                      0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uruguay                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                         0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vanuatu                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Venezuela                          0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vietnam                            0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.               0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Yemen                              0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zambia                             0.009676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                           0.009676
                                                                                                     t value
(Intercept)                                                                                          224.066
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male                                       188.159
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Albania                           45.268
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Algeria                            4.701
pull(filter(diet_and_guidelines, food == "red meat"), location_name)American Samoa                    48.281
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Andorra                           77.368
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Angola                            25.884
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda               30.932
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Argentina                         85.164
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Armenia                           40.764
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Australia                         84.190
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Austria                           90.006
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                        30.380
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bahrain                           29.883
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bangladesh                       -63.185
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Barbados                          32.063
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belarus                           71.003
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belgium                           69.961
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belize                            18.249
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Benin                            -33.764
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bermuda                           43.875
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bhutan                           -12.422
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bolivia                           50.950
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina            17.636
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Botswana                          13.823
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brazil                            76.525
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brunei                            22.921
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bulgaria                          70.318
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                       9.608
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burundi                          -20.355
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cambodia                          11.432
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cameroon                          -5.724
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Canada                            68.966
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cape Verde                        40.819
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Central African Republic          38.159
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chad                               4.493
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chile                             69.255
pull(filter(diet_and_guidelines, food == "red meat"), location_name)China                             65.532
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Colombia                          37.279
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Comoros                          -11.977
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Congo                            -26.658
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Costa Rica                        39.246
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                    -40.002
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Croatia                           60.089
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cuba                              35.928
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cyprus                            62.086
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Czech Republic                    66.918
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo -14.500
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Denmark                           68.497
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Djibouti                          21.152
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominica                          20.347
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominican Republic                28.842
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ecuador                           53.372
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Egypt                             14.265
pull(filter(diet_and_guidelines, food == "red meat"), location_name)El Salvador                        4.466
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                 42.898
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Eritrea                          -14.668
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Estonia                           56.008
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ethiopia                         -17.915
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia    21.638
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Fiji                              30.749
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Finland                           64.642
pull(filter(diet_and_guidelines, food == "red meat"), location_name)France                            72.426
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Gabon                             19.326
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Georgia                           23.576
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Germany                           72.655
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ghana                            -35.838
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greece                            68.937
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greenland                         79.425
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Grenada                           22.059
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guam                              59.684
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guatemala                          0.931
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea                           -20.139
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                     13.785
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guyana                           -22.363
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Haiti                             -5.274
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Honduras                          12.172
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Hungary                           63.109
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iceland                           68.143
pull(filter(diet_and_guidelines, food == "red meat"), location_name)India                            -67.234
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Indonesia                        -22.635
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iran                              -4.714
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iraq                             -32.918
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ireland                           82.776
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Israel                            50.019
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Italy                             68.571
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jamaica                           -3.466
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Japan                             38.683
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jordan                            11.341
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                        67.969
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kenya                             10.839
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kiribati                          13.504
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kuwait                            37.790
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                        43.861
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Laos                              23.219
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Latvia                            59.226
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lebanon                           34.180
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lesotho                            8.149
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Liberia                          -39.355
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Libya                             10.541
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lithuania                         67.486
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Luxembourg                        82.787
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Macedonia                         32.620
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Madagascar                         1.051
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malawi                           -24.893
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malaysia                          13.119
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Maldives                         -13.584
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mali                              26.091
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malta                             67.626
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                  25.014
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritania                        26.188
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritius                          8.742
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mexico                            51.032
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Moldova                           25.684
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mongolia                          82.916
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Montenegro                        71.858
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Morocco                            4.804
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mozambique                       -15.100
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Myanmar                           16.676
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Namibia                           28.060
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nepal                             -0.382
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Netherlands                       71.216
pull(filter(diet_and_guidelines, food == "red meat"), location_name)New Zealand                       81.950
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nicaragua                        -11.263
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Niger                             19.773
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nigeria                          -17.568
pull(filter(diet_and_guidelines, food == "red meat"), location_name)North Korea                      -25.442
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands          44.958
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Norway                            68.560
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Oman                              38.972
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Pakistan                           1.511
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Palestine                         -0.291
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Panama                            49.327
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                  18.389
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Paraguay                          62.165
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Peru                              -3.825
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Philippines                       35.583
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Poland                            71.017
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Portugal                          75.827
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                       42.581
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Qatar                             44.434
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Romania                           67.435
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Russian Federation                55.392
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Rwanda                           -28.711
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                       21.926
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines  20.329
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Samoa                             27.692
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe             -4.922
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                       5.945
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Senegal                           -7.534
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Serbia                            52.541
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Seychelles                        31.180
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                     -53.994
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Singapore                         60.209
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovakia                          64.813
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovenia                          70.174
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                   -1.066
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Somalia                          -26.497
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Africa                      45.002
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Korea                       61.273
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Sudan                        1.585
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Spain                             70.114
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                        -77.506
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sudan                             -5.247
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Suriname                          18.266
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Swaziland                         31.179
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sweden                            71.518
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Switzerland                       72.542
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Syria                             -1.230
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Taiwan                            70.021
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tajikistan                         1.597
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tanzania                         -13.384
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Thailand                          17.040
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Bahamas                       59.715
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Gambia                       -40.206
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                        6.263
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Togo                             -31.896
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tonga                             29.870
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago               16.582
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tunisia                           -0.526
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkey                             5.180
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                      74.708
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uganda                             1.567
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ukraine                           38.488
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates              29.291
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Kingdom                    57.461
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United States                     73.271
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uruguay                           65.345
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                        47.407
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vanuatu                           19.745
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Venezuela                         45.421
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vietnam                           51.154
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.              45.287
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Yemen                            -13.108
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zambia                           -10.780
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                           4.812
                                                                                                     Pr(>|t|)
(Intercept)                                                                                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male                                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Albania                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Algeria                          4.90e-06
pull(filter(diet_and_guidelines, food == "red meat"), location_name)American Samoa                    < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Andorra                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Angola                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda               < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Argentina                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Armenia                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Australia                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Austria                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bahrain                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bangladesh                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Barbados                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belarus                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belgium                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belize                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Benin                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bermuda                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bhutan                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bolivia                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Botswana                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brazil                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brunei                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bulgaria                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                      < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burundi                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cambodia                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cameroon                         3.90e-08
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Canada                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cape Verde                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Central African Republic          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chad                             1.20e-05
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chile                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)China                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Colombia                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Comoros                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Congo                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Costa Rica                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                     < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Croatia                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cuba                              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cyprus                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Czech Republic                    < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo  < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Denmark                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Djibouti                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominica                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominican Republic                < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ecuador                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Egypt                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)El Salvador                      1.35e-05
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                 < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Eritrea                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Estonia                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ethiopia                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia    < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Fiji                              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Finland                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)France                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Gabon                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Georgia                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Germany                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ghana                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greece                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greenland                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Grenada                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guam                              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guatemala                        0.353203
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                     < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guyana                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Haiti                            3.54e-07
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Honduras                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Hungary                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iceland                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)India                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Indonesia                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iran                             4.63e-06
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iraq                              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ireland                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Israel                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Italy                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jamaica                          0.000650
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Japan                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jordan                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kenya                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kiribati                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kuwait                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Laos                              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Latvia                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lebanon                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lesotho                          4.43e-14
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Liberia                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Libya                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lithuania                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Luxembourg                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Macedonia                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Madagascar                       0.294507
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malawi                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malaysia                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Maldives                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mali                              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malta                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                  < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritania                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritius                        1.09e-15
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mexico                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Moldova                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mongolia                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Montenegro                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Morocco                          3.11e-06
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mozambique                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Myanmar                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Namibia                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nepal                            0.703082
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Netherlands                       < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)New Zealand                       < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nicaragua                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Niger                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nigeria                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)North Korea                       < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Norway                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Oman                              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Pakistan                         0.132342
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Palestine                        0.771045
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Panama                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                  < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Paraguay                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Peru                             0.000176
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Philippines                       < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Poland                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Portugal                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                       < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Qatar                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Romania                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Russian Federation                < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Rwanda                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                       < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines  < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Samoa                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe            1.83e-06
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                     1.26e-08
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Senegal                          1.83e-12
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Serbia                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Seychelles                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                      < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Singapore                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovakia                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovenia                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                  0.287747
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Somalia                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Africa                      < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Korea                       < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Sudan                      0.114522
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Spain                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sudan                            4.04e-07
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Suriname                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Swaziland                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sweden                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Switzerland                       < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Syria                            0.220097
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Taiwan                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tajikistan                       0.111900
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tanzania                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Thailand                          < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Bahamas                       < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Gambia                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                      2.38e-09
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Togo                              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tonga                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago               < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tunisia                          0.599486
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkey                           5.55e-07
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                      < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uganda                           0.118652
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ukraine                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Kingdom                    < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United States                     < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uruguay                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                        < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vanuatu                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Venezuela                         < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vietnam                           < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.              < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Yemen                             < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zambia                            < 2e-16
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                         2.99e-06
                                                                                                        
(Intercept)                                                                                          ***
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male                                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Albania                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Algeria                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)American Samoa                   ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Andorra                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Angola                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda              ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Argentina                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Armenia                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Australia                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Austria                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bahrain                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bangladesh                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Barbados                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belarus                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belgium                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Belize                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Benin                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bermuda                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bhutan                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bolivia                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Botswana                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brazil                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Brunei                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Bulgaria                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                     ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Burundi                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cambodia                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cameroon                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Canada                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cape Verde                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Central African Republic         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chad                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Chile                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)China                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Colombia                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Comoros                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Congo                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Costa Rica                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                    ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Croatia                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cuba                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Cyprus                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Czech Republic                   ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Denmark                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Djibouti                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominica                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Dominican Republic               ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ecuador                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Egypt                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)El Salvador                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Eritrea                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Estonia                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ethiopia                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia   ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Fiji                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Finland                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)France                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Gabon                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Georgia                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Germany                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ghana                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greece                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Greenland                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Grenada                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guam                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guatemala                           
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                    ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Guyana                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Haiti                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Honduras                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Hungary                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iceland                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)India                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Indonesia                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iran                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Iraq                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ireland                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Israel                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Italy                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jamaica                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Japan                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Jordan                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kenya                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kiribati                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kuwait                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Laos                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Latvia                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lebanon                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lesotho                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Liberia                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Libya                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Lithuania                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Luxembourg                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Macedonia                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Madagascar                          
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malawi                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malaysia                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Maldives                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mali                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Malta                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                 ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritania                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mauritius                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mexico                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Moldova                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mongolia                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Montenegro                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Morocco                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Mozambique                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Myanmar                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Namibia                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nepal                               
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Netherlands                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)New Zealand                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nicaragua                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Niger                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Nigeria                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)North Korea                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Norway                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Oman                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Pakistan                            
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Palestine                           
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Panama                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                 ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Paraguay                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Peru                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Philippines                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Poland                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Portugal                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Qatar                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Romania                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Russian Federation               ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Rwanda                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Samoa                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                     ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Senegal                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Serbia                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Seychelles                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                     ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Singapore                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovakia                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Slovenia                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                     
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Somalia                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Africa                     ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Korea                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)South Sudan                         
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Spain                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sudan                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Suriname                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Swaziland                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Sweden                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Switzerland                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Syria                               
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Taiwan                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tajikistan                          
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tanzania                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Thailand                         ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Bahamas                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)The Gambia                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                      ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Togo                             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tonga                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago              ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Tunisia                             
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkey                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                     ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uganda                              
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Ukraine                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United Kingdom                   ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)United States                    ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uruguay                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                       ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vanuatu                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Venezuela                        ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Vietnam                          ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.             ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Yemen                            ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zambia                           ***
pull(filter(diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                         ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.009676 on 194 degrees of freedom
Multiple R-squared:  0.9996,    Adjusted R-squared:  0.9993 
F-statistic:  2671 on 195 and 194 DF,  p-value: < 2.2e-16

Paired \(t\)-test and linear model with mixed effects

Alternatively, we can perform a slightly different regression.

In this case we will use the lmer() function of the lmerTest package. This function allows us to perform what is called a linear mixed effects regression. This type of regression is called mixed because it contains both fixed and random effects.

There are many different definitions for fixed and random effects and the difference is conceptually complex and context specific. However in simplistic terms, fixed effects are generally speaking the variables of interest that we have reason to believe explain or predict the outcome or response variable, while random effects are those that may introduce additional variance in the influence of those predictor variables on the outcome variable. For example, they may provide information about group or batch structures within the data.

In our case, we are interested in the influence of sex on the consumption of red meat, however the identity of the country where the male and female consumption values were obtained may influence this relationship and we would like to control for that. In other words, we are interested in getting a sense of how sex influences consumption rates in general and we want to account for the paired structure within our data, the fact that we have corresponding consumption values for the two sexes from different countries. The notation for including a random effect like this is 1 | variable_name. The one indicates a varying-intercept group effect, in otherwords we expect that the intercept may vary for each value of the variable indicated to the right of the |. So in our case, the intercept (mean_percent consumption when sex is assigned to the zero value - not male) may be different for each country.

Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
log10(pull(filter(diet_and_guidelines, food == "red meat"), mean_percent)) ~  
    pull(filter(diet_and_guidelines, food == "red meat"), sex) +  
        (1 | pull(filter(diet_and_guidelines, food == "red meat"),  
            location_name))

REML criterion at convergence: -969.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.2253 -0.3914 -0.0038  0.3993  3.2527 

Random effects:
 Groups                                                              
 pull(filter(diet_and_guidelines, food == "red meat"), location_name)
 Residual                                                            
 Name        Variance  Std.Dev.
 (Intercept) 1.171e-01 0.342181
             9.363e-05 0.009676
Number of obs: 390, groups:  
pull(filter(diet_and_guidelines, food == "red meat"), location_name), 195

Fixed effects:
                                                                Estimate
(Intercept)                                                    1.799e+00
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male 1.844e-01
                                                               Std. Error
(Intercept)                                                     2.451e-02
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male  9.799e-04
                                                                      df
(Intercept)                                                    1.942e+02
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male 1.940e+02
                                                               t value
(Intercept)                                                      73.38
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male  188.16
                                                               Pr(>|t|)
(Intercept)                                                      <2e-16
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male   <2e-16
                                                                  
(Intercept)                                                    ***
pull(filter(diet_and_guidelines, food == "red meat"), sex)Male ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr)
p((__,f="ms -0.020

    Paired t-test

data:  log10(pull(filter(wide_diet, food == "red meat"), mean_percent_Male)) and log10(pull(filter(wide_diet, food == "red meat"), mean_percent_Female))
t = 188.16, df = 194, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 0.1824542 0.1863197
sample estimates:
mean of the differences 
               0.184387 

You can see that now our degrees of freedom are 194, which makes sense becuase now we have matched or paired values for the 195 different regions and so \(df = n-1 parameter = 195 -1 = 194\). In this case we aren’t calculating two different means in our t-test, but instead this is a one sample t-test of the differences between males and females across all the country pairs, so thus only one parameter. It is more complicated to calculate the degrees of freedom in the mixed effect model and beyond this case study, but it is based on the Satterthwaite formula and results in the same degrees of freedom.

Most importantly, again we get the same \(t\)-value and p-value with the two tests.

You can see that yet again our degrees of freedom are 194, and again we get the same \(t\)-value and p-value with all tests. In this case we also have information about how each of the countries might influence mean consumption. So the decision of which test to perform depends on your question of interest. In this case we were particularlly interested in the influence of sex, so setting location_name to a random effect provides the same level of detail about sex without as much information about location_name, so that might be ideal. The results as we can see are the same.

We can conclude from these tests that we have enough evidence to reject the null hypothesis that there is no difference between the means or that sex has no association or influence on red meat consumption. Therefore, it appears that men consume significantly more red meat than females globally.

Let’s choose another dietary factor to compare between males and females.


    Mood two-sample test of scale

data:  pull(filter(diet_and_guidelines, food == "fruits"), mean_percent) and pull(filter(diet_and_guidelines, food == "fruits"), sex)
Z = 0, p-value = 1
alternative hypothesis: two.sided

    F test to compare two variances

data:  log10(pull(filter(diet_and_guidelines, food == "fruits"), mean_percent)) by pull(filter(diet_and_guidelines, food == "fruits"), sex)
F = 1.0025, num df = 194, denom df = 194, p-value = 0.9859
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
 0.7559929 1.3295002
sample estimates:
ratio of variances 
          1.002543 
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
log10(pull(filter(diet_and_guidelines, food == "fruits"), mean_percent)) ~  
    pull(filter(diet_and_guidelines, food == "fruits"), sex) +  
        (1 | pull(filter(diet_and_guidelines, food == "fruits"),  
            location_name))

REML criterion at convergence: -1245.3

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-6.4919 -0.3057 -0.0005  0.2940  6.5088 

Random effects:
 Groups                                                            
 pull(filter(diet_and_guidelines, food == "fruits"), location_name)
 Residual                                                          
 Name        Variance  Std.Dev.
 (Intercept) 8.212e-02 0.286573
             3.222e-05 0.005676
Number of obs: 390, groups:  
pull(filter(diet_and_guidelines, food == "fruits"), location_name), 195

Fixed effects:
                                                               Estimate
(Intercept)                                                   1.562e+00
pull(filter(diet_and_guidelines, food == "fruits"), sex)Male -5.570e-02
                                                             Std. Error
(Intercept)                                                   2.053e-02
pull(filter(diet_and_guidelines, food == "fruits"), sex)Male  5.748e-04
                                                                     df
(Intercept)                                                   1.941e+02
pull(filter(diet_and_guidelines, food == "fruits"), sex)Male  1.940e+02
                                                             t value
(Intercept)                                                    76.12
pull(filter(diet_and_guidelines, food == "fruits"), sex)Male  -96.89
                                                             Pr(>|t|)    
(Intercept)                                                    <2e-16 ***
pull(filter(diet_and_guidelines, food == "fruits"), sex)Male   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr)
p((__,f=="s -0.014

    Paired t-test

data:  log10(pull(filter(wide_diet, food == "fruits"), mean_percent_Female)) and log10(pull(filter(wide_diet, food == "fruits"), mean_percent_Male))
t = 96.892, df = 194, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 0.05456356 0.05683104
sample estimates:
mean of the differences 
              0.0556973 
# A tibble: 1 x 2
  female  male
   <dbl> <dbl>
1   1.56  1.51

Notice here that the mean of the differences value is indeed the same as the coefficient and the \(t\)-value and the \(p\)-value match. The \(\beta_{1}\) coefficient value (slope) matches the difference between the means value calcuated in \(t\)-test. The intercept coefficient \(\beta_{0}\) value of 1.56 (when sex is zero or female) also matches the mean value for the female group when calculated separately.

ANalysis Of VAriance (ANOVA) test

Now we are interested in the influence of age group on dietary consumption, becuase there are 15 age groups we can’t assess the influence of age group on consumption using the \(t\)-test, as this test can only compare 2 groups.

If we wanted to test the hypothesis that there are any age group differences, that at least one of the groups is different from the others; we could use an ANOVA test. This test allows us to compare means of 3 or more groups by evaluating the variance of the data within the groups and among the groups.

Our null hypothesis is that all age groups have equal means: \[ H_0: \mu_{1} = \mu_{2} =\mu_{3}=\mu_{4} = ... \mu_{15} \]

The alternative hypothesis is that at least one age group mean is not equal to the others.

Importantly, if we reject the null, we do not know which group means are different from one another. Subsequent testing is required if we want to know this information. In this case we call this type of non-specific hypothesis an “omnibus” hypothesis.

You could actually perform an ANOVA to compare two means, but in this case you would get an \(F\)-statistic instead of a \(t\)-statistic which would be quivalent to \(t^2\). However it is not conventional to use ANOVA for only 2 means. The \(F\)-statistic is derived form the \(F\)-test is used for a few different type of tests. In the anova the F-test is calculated as:

\[F = \frac{ variability\ between\ the \ groups}{ variablity\ within\ the \ groups}\]

The larger the ratio, the larger the variability between the groups, thus the more likely that the data for each group comes from a different distribution with different means, suggesting that the groups are different.

It turns out that the ANOVA test is also equivalent to a specialized form of regression.

We will demonstrate this by evaluating how the consumption of red meat varies by age group using an anova and a linear regression.

Thinking about our interest in wanting to know how consumtion differs between age groups from the linear regression perspective, we could also describe our null hypothesis as:

There is no influence of age group idenity on consumption or there is no relationship between age group identity and consumption.

And we could describe our alternative hypothesis as:

Age group identity does influence consumption or explain some of the variation in consumption.

Ok, so let’s take a look at our data.

First let’s make age_group_name a factor:

ANOVA assumptions

The ANOVA assumptions are quite similar to the \(t\)-test assumptions:

  1. Normality of the data for all tested groups (less of an issue if the number of observations is relatively large total n>30)
  2. Equal variance between the groups - aka Homogeneity of variance (make sure you do the correct test if the data is not normal)
  3. Balanced sample sizes of the groups
  4. Independent observations (or independent paired observations)

So let’s evaluate our assumptions for the groups we are comparing, starting with normality using QQ plots. We will assess fruit consumption again.

Ok, these look pretty good.

Now let’s look at variance.

The Bartlett’s test works well if the data appears to be quite normally distributed, while the Fligner-Killeen test is nonparametric and does not assume normality of the data. Another popular test is the Levene’s test, is more robust to violations of normality than the Bartlett’s test, but not as robust as the Fligner- Killeen test.

All three tests test the null hypothesis that the variances are equal among all of the groups.

Note: Remember that \(\sigma\) is the standard deviation and that variance = \(\sigma^2\)

recall that \(\sigma^2 = \frac{\sum(x_i - \mu)^2}{N}\) when we are thinking of the true populations of the groups

Where \(N\) is the population size \(x_i\) are each value from the population \(\mu\) is the mean of the population

Thus the variance is the average difference of the values in the distribution from the mean of the distribution.

\[ H_0: \sigma_1^2 = \sigma_2^2 = \sigma_3^2 ... = \sigma_n^2 \]

The alternative hypothesis is that at least one of the group \(\sigma_i^2\) is not equal to the other group \(\sigma^2\) values.

\[H_a:\sigma_i^2 \neq \sigma_j^2 \] for at least one pair (\(i\),\(j\))

In our case, the data appears to be quite normally distributed, however we will demonstrate how to perform each of these tests.

The bartlett.test() function of the stats package can be used to perform the Bartlett’s test, the fligner.test() function of the stats package can be used to perform the Fligner-Killeen test and the leveneTest() function of the car package can be used for the Levene’s test.


    Bartlett test of homogeneity of variances

data:  log10(pull(filter(all_age_diet_and_guidelines, food == "red meat"), mean_percent)) by pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)
Bartlett's K-squared = 11.139, df = 14, p-value = 0.6751
Levene's Test for Homogeneity of Variance (center = median)
        Df F value Pr(>F)
group   14   0.484 0.9429
      5835               

    Fligner-Killeen test of homogeneity of variances

data:  log10(pull(filter(all_age_diet_and_guidelines, food == "red meat"), mean_percent)) by pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)
Fligner-Killeen:med chi-squared = 7.7956, df = 14, p-value =
0.8997

In all cases our data does not appear to violate the Homogeneity of Variances assumption as our p value was < 0.05 for all three tests, thus there is not enough evidence to reject the null.

We will also confirm again that our data is balanced for all groups, meaning we have the same or similiar number of samples for each group.

# A tibble: 15 x 2
   age_group_name     n
   <chr>          <int>
 1 25 to 29         390
 2 30 to 34         390
 3 35 to 39         390
 4 40 to 44         390
 5 45 to 49         390
 6 50 to 54         390
 7 55 to 59         390
 8 60 to 64         390
 9 65 to 69         390
10 70 to 74         390
11 75 to 79         390
12 80 to 84         390
13 85 to 89         390
14 90 to 94         390
15 95 plus          390

Now we will use the aov() function of the stats package. We will be performing what is called a one-way ANOVA becuase we only have one dependent/response/outcome variable.

                                                                                Df
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   14
Residuals                                                                     5835
                                                                              Sum Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   47.6
Residuals                                                                      870.7
                                                                              Mean Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   3.403
Residuals                                                                       0.149
                                                                              F value
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)    22.8
Residuals                                                                            
                                                                              Pr(>F)
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) <2e-16
Residuals                                                                           
                                                                                 
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) ***
Residuals                                                                        
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Call:
lm(formula = log10(mean_percent) ~ age_group_name, data = .)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.06714 -0.28094  0.00305  0.29301  1.17376 

Coefficients:
                        Estimate Std. Error t value Pr(>|t|)    
(Intercept)             1.994651   0.019561 101.973  < 2e-16 ***
age_group_name30 to 34 -0.003525   0.027663  -0.127 0.898605    
age_group_name35 to 39 -0.006997   0.027663  -0.253 0.800322    
age_group_name40 to 44 -0.016040   0.027663  -0.580 0.562037    
age_group_name45 to 49 -0.032271   0.027663  -1.167 0.243425    
age_group_name50 to 54 -0.050053   0.027663  -1.809 0.070442 .  
age_group_name55 to 59 -0.069398   0.027663  -2.509 0.012144 *  
age_group_name60 to 64 -0.091436   0.027663  -3.305 0.000954 ***
age_group_name65 to 69 -0.116689   0.027663  -4.218 2.50e-05 ***
age_group_name70 to 74 -0.142474   0.027663  -5.150 2.68e-07 ***
age_group_name75 to 79 -0.169369   0.027663  -6.123 9.80e-10 ***
age_group_name80 to 84 -0.228844   0.027663  -8.273  < 2e-16 ***
age_group_name85 to 89 -0.235069   0.027663  -8.498  < 2e-16 ***
age_group_name90 to 94 -0.238725   0.027663  -8.630  < 2e-16 ***
age_group_name95 plus  -0.239223   0.027663  -8.648  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.3863 on 5835 degrees of freedom
Multiple R-squared:  0.05188,   Adjusted R-squared:  0.0496 
F-statistic:  22.8 on 14 and 5835 DF,  p-value: < 2.2e-16

We can see that the \(F\)-statistic (at the bottom of the lm output) is the same in both outputs and the p-value for the \(F\)-statistic is the same!

We also see that the degrees of freedom for the \(F\)-statistic is 14. This makes sense because we have 15 different age groups and degrees of freedom for the \(F\)-statistic are calculated as \[df = n - 1\].

So in our case: \[df = 15 -1\] The difference here is that with the lm() test we also get information about how the individual age groups influence mean_percent consumption of fruits. Notice that if we look at all the age groups:

# A tibble: 15 x 1
   age_group_name
   <chr>         
 1 25 to 29      
 2 30 to 34      
 3 35 to 39      
 4 40 to 44      
 5 45 to 49      
 6 50 to 54      
 7 55 to 59      
 8 60 to 64      
 9 65 to 69      
10 70 to 74      
11 75 to 79      
12 80 to 84      
13 85 to 89      
14 90 to 94      
15 95 plus       

We can see that our lm() results are missing one of the age groups, the 25 to 29 age group. That is because this is the reference group and the coefficients indicate the slope or difference in mean_percent consupmtion rates for each listed age group compared to the reference group.

Now let’s account for the paired location_name structure within our data as well. To do this we add this as another term in the aov() and the lm() formula with a +. Note that now that we have two categorical independent variables / covariates/ predictors. In this case we are comparing both the age groups and the location groups. The anova() function of the stats package will be used with the lm() function print the resulting \(F\)-statistic, but not the statistics for each of the levels of the age groups and location groups. This function does not actually directly perform ANOVA like the aov() function, but instead prints a variance table using a lm() or glm() object.

                                                                                Df
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   14
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)   194
Residuals                                                                     5641
                                                                              Sum Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   47.6
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)   819.7
Residuals                                                                       51.0
                                                                              Mean Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   3.403
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)    4.225
Residuals                                                                       0.009
                                                                              F value
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   376.1
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)    467.0
Residuals                                                                            
                                                                              Pr(>F)
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) <2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)  <2e-16
Residuals                                                                           
                                                                                 
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)  ***
Residuals                                                                        
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Analysis of Variance Table

Response: log10(pull(filter(all_age_diet_and_guidelines, food == "red meat"), 
Response:     mean))
                                                                                Df
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   14
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)   194
Residuals                                                                     5641
                                                                              Sum Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)  47.64
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)  819.66
Residuals                                                                      51.04
                                                                              Mean Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)  3.4029
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)   4.2250
Residuals                                                                      0.0090
                                                                              F value
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)  376.12
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)   466.99
Residuals                                                                            
                                                                                 Pr(>F)
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) < 2.2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)  < 2.2e-16
Residuals                                                                              
                                                                                 
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)  ***
Residuals                                                                        
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

We can see that indeed the \(F\)-values and p-values match. In this case, this analysis suggests that there is a significant infleunce of age group identity on consumption, even when controlling for location identity and vice versa. The ANOVA results indicate that the means are different across these groups, but it does not inform us about which groups are different. If we instead perform the lm() analysis and use summary() to print the results instead of anova(), we can get more information about possible specific group differences. Recall however, that these are relative to the refernce level for the age group and location and that these values are calculated for the effect on consumption while controlling for the other model term.


Call:
lm(formula = log10(pull(filter(all_age_diet_and_guidelines, food == 
    "red meat"), mean)) ~ pull(filter(all_age_diet_and_guidelines, 
    food == "red meat"), age_group_name) + pull(filter(all_age_diet_and_guidelines, 
    food == "red meat"), location_name))

Residuals:
     Min       1Q   Median       3Q      Max 
-0.21003 -0.08909 -0.00097  0.09118  0.33175 

Coefficients:
                                                                                                               Estimate
(Intercept)                                                                                                   1.0250799
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)30 to 34                        -0.0035250
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)35 to 39                        -0.0069971
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)40 to 44                        -0.0160403
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)45 to 49                        -0.0322710
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)50 to 54                        -0.0500527
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)55 to 59                        -0.0693983
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)60 to 64                        -0.0914365
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)65 to 69                        -0.1166894
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)70 to 74                        -0.1424738
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)75 to 79                        -0.1693692
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)80 to 84                        -0.2288442
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)85 to 89                        -0.2350692
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)90 to 94                        -0.2387255
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)95 plus                         -0.2392227
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Albania                           0.4696634
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Algeria                           0.0524978
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)American Samoa                    0.4781072
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Andorra                           0.7709817
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Angola                            0.2502250
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda               0.3148782
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Argentina                         0.8391115
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Armenia                           0.4143613
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Australia                         0.8382715
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Austria                           0.9006351
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                        0.3013522
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bahrain                           0.2892541
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bangladesh                       -0.6036909
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Barbados                          0.3355809
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belarus                           0.7101162
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belgium                           0.7081735
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belize                            0.1840253
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Benin                            -0.3251738
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bermuda                           0.4539095
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bhutan                           -0.1193613
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bolivia                           0.5011897
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina            0.1966458
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Botswana                          0.1360033
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brazil                            0.7420931
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brunei                            0.2248900
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bulgaria                          0.7016126
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                      0.0952272
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burundi                          -0.1975274
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cambodia                          0.7246230
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cameroon                         -0.0547177
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Canada                            0.6965652
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cape Verde                        0.4033481
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Central African Republic          0.3695721
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chad                              0.0445016
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chile                             0.6899420
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)China                             0.9036505
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Colombia                          0.3677083
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Comoros                          -0.1092061
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Congo                            -0.2562887
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Costa Rica                        0.3922246
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                    -0.3878599
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Croatia                           0.6168738
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cuba                              0.3715729
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cyprus                            0.6210060
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Czech Republic                    0.6754221
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo -0.1381953
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Denmark                           0.6940034
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Djibouti                          0.2040664
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominica                          0.2201500
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominican Republic                0.2904822
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ecuador                           0.5001219
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Egypt                             0.1407597
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)El Salvador                       0.0564578
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                 0.4145078
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Eritrea                          -0.1427694
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Estonia                           0.5724487
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ethiopia                         -0.1749948
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia    0.2177319
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Fiji                              0.3063835
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Finland                           0.6616460
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)France                            0.7352843
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Gabon                             0.1926532
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Georgia                           0.2530224
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Germany                           0.7386742
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ghana                            -0.3464979
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greece                            0.7022224
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greenland                         0.7880282
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Grenada                           0.2394215
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guam                              0.5937555
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guatemala                         0.0139062
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea                           -0.1905498
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                     0.1322312
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guyana                           -0.2063983
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Haiti                            -0.0491435
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Honduras                          0.1244476
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Hungary                           0.6410019
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iceland                           0.6839722
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)India                            -0.6388459
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Indonesia                         0.9884246
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iran                             -0.0399115
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iraq                             -0.3147627
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ireland                           0.8205275
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Israel                            0.5031271
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Italy                             0.7012419
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jamaica                          -0.0196064
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Japan                             0.4163050
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jordan                            0.1122555
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                        0.6667740
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kenya                             0.1062621
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kiribati                          0.1360152
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kuwait                            0.3628791
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                        0.4299491
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Laos                              1.2383820
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Latvia                            0.6051096
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lebanon                           0.3358240
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lesotho                           0.0827870
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Liberia                          -0.3810751
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Libya                             0.1058210
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lithuania                         0.6853303
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Luxembourg                        0.8252128
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Macedonia                         0.3375009
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Madagascar                        0.0086607
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malawi                           -0.2390062
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malaysia                          0.9037008
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Maldives                          0.9341352
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mali                              0.2545834
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malta                             0.6861462
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                  0.2453513
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritania                        0.2586036
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritius                         0.1018209
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mexico                            0.5019364
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Moldova                           0.2694136
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mongolia                          0.8050147
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Montenegro                        0.7197936
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Morocco                           0.0536665
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mozambique                       -0.1454548
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Myanmar                           0.9679235
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Namibia                           0.2766865
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nepal                             0.0040043
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Netherlands                       0.7182009
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)New Zealand                       0.8215769
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nicaragua                        -0.1022029
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Niger                             0.1929072
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nigeria                          -0.1687456
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)North Korea                       0.9568532
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands          0.4519371
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Norway                            0.6802116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Oman                              0.3715916
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Pakistan                          0.0163832
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Palestine                        -0.0001115
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Panama                            0.4910430
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                  0.1780454
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Paraguay                          0.6105228
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Peru                             -0.0270767
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Philippines                       0.9642365
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Poland                            0.7119822
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Portugal                          0.7651172
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                       0.4442532
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Qatar                             0.4226739
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Romania                           0.6732206
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Russian Federation                0.5601442
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Rwanda                           -0.2771514
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                       0.2295368
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines  0.2179043
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Samoa                             0.2797823
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe            -0.0434018
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                      0.0524593
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Senegal                          -0.0681700
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Serbia                            0.5359842
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Seychelles                        0.3146719
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                     -0.5214405
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Singapore                         0.5946425
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovakia                          0.6438632
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovenia                          0.7116904
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                  -0.0090348
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Somalia                          -0.2564213
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Africa                      0.4267033
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Korea                       0.5949378
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Sudan                       0.0164738
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Spain                             0.7138244
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                         0.8976439
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sudan                            -0.0465153
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Suriname                          0.1906880
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Swaziland                         0.3040096
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sweden                            0.7247779
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Switzerland                       0.7281804
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Syria                            -0.0024640
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Taiwan                            0.9249290
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tajikistan                        0.0176046
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tanzania                         -0.1278459
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Thailand                          0.8582708
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Bahamas                       0.5890517
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Gambia                       -0.3863879
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                       1.2355139
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Togo                             -0.3083612
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tonga                             0.3002675
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago               0.1770619
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tunisia                           0.0071742
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkey                            0.0631309
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                      0.7290156
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uganda                            0.0146972
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ukraine                           0.3932282
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates              0.2716685
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Kingdom                    0.5932920
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United States                     0.7390080
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uruguay                           0.6597541
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                        0.4620568
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vanuatu                           0.1977037
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Venezuela                         0.4446078
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vietnam                           0.5087180
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.              0.4675163
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Yemen                            -0.1277139
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zambia                           -0.1062726
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                          0.0462498
                                                                                                             Std. Error
(Intercept)                                                                                                   0.0179787
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)30 to 34                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)35 to 39                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)40 to 44                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)45 to 49                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)50 to 54                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)55 to 59                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)60 to 64                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)65 to 69                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)70 to 74                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)75 to 79                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)80 to 84                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)85 to 89                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)90 to 94                         0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)95 plus                          0.0068116
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Albania                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Algeria                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)American Samoa                    0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Andorra                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Angola                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda               0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Argentina                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Armenia                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Australia                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Austria                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bahrain                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bangladesh                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Barbados                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belarus                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belgium                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belize                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Benin                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bermuda                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bhutan                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bolivia                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Botswana                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brazil                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brunei                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bulgaria                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                      0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burundi                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cambodia                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cameroon                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Canada                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cape Verde                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Central African Republic          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chad                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chile                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)China                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Colombia                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Comoros                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Congo                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Costa Rica                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                     0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Croatia                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cuba                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cyprus                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Czech Republic                    0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo  0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Denmark                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Djibouti                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominica                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominican Republic                0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ecuador                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Egypt                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)El Salvador                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                 0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Eritrea                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Estonia                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ethiopia                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia    0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Fiji                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Finland                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)France                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Gabon                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Georgia                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Germany                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ghana                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greece                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greenland                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Grenada                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guam                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guatemala                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                     0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guyana                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Haiti                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Honduras                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Hungary                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iceland                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)India                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Indonesia                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iran                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iraq                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ireland                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Israel                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Italy                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jamaica                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Japan                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jordan                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kenya                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kiribati                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kuwait                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Laos                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Latvia                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lebanon                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lesotho                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Liberia                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Libya                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lithuania                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Luxembourg                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Macedonia                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Madagascar                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malawi                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malaysia                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Maldives                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mali                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malta                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                  0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritania                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritius                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mexico                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Moldova                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mongolia                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Montenegro                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Morocco                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mozambique                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Myanmar                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Namibia                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nepal                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Netherlands                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)New Zealand                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nicaragua                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Niger                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nigeria                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)North Korea                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Norway                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Oman                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Pakistan                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Palestine                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Panama                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                  0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Paraguay                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Peru                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Philippines                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Poland                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Portugal                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Qatar                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Romania                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Russian Federation                0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Rwanda                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines  0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Samoa                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                      0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Senegal                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Serbia                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Seychelles                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                      0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Singapore                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovakia                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovenia                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                   0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Somalia                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Africa                      0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Korea                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Sudan                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Spain                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sudan                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Suriname                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Swaziland                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sweden                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Switzerland                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Syria                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Taiwan                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tajikistan                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tanzania                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Thailand                          0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Bahamas                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Gambia                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                       0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Togo                              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tonga                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago               0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tunisia                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkey                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                      0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uganda                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ukraine                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Kingdom                    0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United States                     0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uruguay                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                        0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vanuatu                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Venezuela                         0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vietnam                           0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.              0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Yemen                             0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zambia                            0.0245594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                          0.0245594
                                                                                                             t value
(Intercept)                                                                                                   57.016
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)30 to 34                         -0.518
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)35 to 39                         -1.027
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)40 to 44                         -2.355
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)45 to 49                         -4.738
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)50 to 54                         -7.348
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)55 to 59                        -10.188
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)60 to 64                        -13.424
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)65 to 69                        -17.131
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)70 to 74                        -20.916
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)75 to 79                        -24.865
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)80 to 84                        -33.596
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)85 to 89                        -34.510
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)90 to 94                        -35.047
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)95 plus                         -35.120
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Albania                           19.124
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Algeria                            2.138
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)American Samoa                    19.467
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Andorra                           31.392
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Angola                            10.189
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda               12.821
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Argentina                         34.167
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Armenia                           16.872
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Australia                         34.132
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Austria                           36.672
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                        12.270
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bahrain                           11.778
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bangladesh                       -24.581
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Barbados                          13.664
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belarus                           28.914
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belgium                           28.835
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belize                             7.493
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Benin                            -13.240
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bermuda                           18.482
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bhutan                            -4.860
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bolivia                           20.407
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina             8.007
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Botswana                           5.538
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brazil                            30.216
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brunei                             9.157
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bulgaria                          28.568
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                       3.877
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burundi                           -8.043
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cambodia                          29.505
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cameroon                          -2.228
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Canada                            28.362
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cape Verde                        16.423
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Central African Republic          15.048
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chad                               1.812
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chile                             28.093
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)China                             36.794
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Colombia                          14.972
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Comoros                           -4.447
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Congo                            -10.435
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Costa Rica                        15.970
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                    -15.793
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Croatia                           25.118
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cuba                              15.130
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cyprus                            25.286
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Czech Republic                    27.502
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo  -5.627
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Denmark                           28.258
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Djibouti                           8.309
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominica                           8.964
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominican Republic                11.828
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ecuador                           20.364
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Egypt                              5.731
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)El Salvador                        2.299
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                 16.878
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Eritrea                           -5.813
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Estonia                           23.309
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ethiopia                          -7.125
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia     8.866
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Fiji                              12.475
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Finland                           26.941
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)France                            29.939
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Gabon                              7.844
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Georgia                           10.302
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Germany                           30.077
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ghana                            -14.109
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greece                            28.593
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greenland                         32.087
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Grenada                            9.749
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guam                              24.176
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guatemala                          0.566
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea                            -7.759
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                      5.384
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guyana                            -8.404
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Haiti                             -2.001
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Honduras                           5.067
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Hungary                           26.100
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iceland                           27.850
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)India                            -26.012
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Indonesia                         40.246
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iran                              -1.625
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iraq                             -12.816
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ireland                           33.410
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Israel                            20.486
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Italy                             28.553
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jamaica                           -0.798
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Japan                             16.951
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jordan                             4.571
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                        27.149
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kenya                              4.327
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kiribati                           5.538
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kuwait                            14.776
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                        17.506
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Laos                              50.424
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Latvia                            24.639
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lebanon                           13.674
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lesotho                            3.371
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Liberia                          -15.516
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Libya                              4.309
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lithuania                         27.905
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Luxembourg                        33.601
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Macedonia                         13.742
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Madagascar                         0.353
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malawi                            -9.732
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malaysia                          36.796
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Maldives                          38.036
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mali                              10.366
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malta                             27.938
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                   9.990
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritania                        10.530
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritius                          4.146
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mexico                            20.438
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Moldova                           10.970
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mongolia                          32.778
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Montenegro                        29.308
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Morocco                            2.185
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mozambique                        -5.923
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Myanmar                           39.411
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Namibia                           11.266
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nepal                              0.163
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Netherlands                       29.243
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)New Zealand                       33.453
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nicaragua                         -4.161
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Niger                              7.855
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nigeria                           -6.871
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)North Korea                       38.961
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands          18.402
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Norway                            27.697
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Oman                              15.130
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Pakistan                           0.667
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Palestine                         -0.005
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Panama                            19.994
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                   7.250
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Paraguay                          24.859
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Peru                              -1.102
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Philippines                       39.261
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Poland                            28.990
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Portugal                          31.154
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                       18.089
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Qatar                             17.210
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Romania                           27.412
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Russian Federation                22.808
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Rwanda                           -11.285
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                        9.346
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines   8.873
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Samoa                             11.392
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe             -1.767
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                       2.136
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Senegal                           -2.776
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Serbia                            21.824
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Seychelles                        12.813
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                     -21.232
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Singapore                         24.212
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovakia                          26.217
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovenia                          28.978
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                   -0.368
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Somalia                          -10.441
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Africa                      17.374
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Korea                       24.224
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Sudan                        0.671
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Spain                             29.065
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                         36.550
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sudan                             -1.894
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Suriname                           7.764
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Swaziland                         12.379
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sweden                            29.511
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Switzerland                       29.650
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Syria                             -0.100
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Taiwan                            37.661
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tajikistan                         0.717
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tanzania                          -5.206
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Thailand                          34.947
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Bahamas                       23.985
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Gambia                       -15.733
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                       50.307
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Togo                             -12.556
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tonga                             12.226
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago                7.210
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tunisia                            0.292
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkey                             2.571
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                      29.684
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uganda                             0.598
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ukraine                           16.011
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates              11.062
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Kingdom                    24.157
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United States                     30.091
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uruguay                           26.864
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                        18.814
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vanuatu                            8.050
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Venezuela                         18.103
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vietnam                           20.714
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.              19.036
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Yemen                             -5.200
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zambia                            -4.327
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                           1.883
                                                                                                             Pr(>|t|)
(Intercept)                                                                                                   < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)30 to 34                        0.604822
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)35 to 39                        0.304354
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)40 to 44                        0.018564
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)45 to 49                        2.21e-06
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)50 to 54                        2.30e-13
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)55 to 59                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)60 to 64                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)65 to 69                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)70 to 74                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)75 to 79                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)80 to 84                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)85 to 89                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)90 to 94                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)95 plus                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Albania                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Algeria                          0.032594
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)American Samoa                    < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Andorra                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Angola                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda               < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Argentina                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Armenia                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Australia                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Austria                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bahrain                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bangladesh                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Barbados                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belarus                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belgium                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belize                           7.77e-14
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Benin                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bermuda                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bhutan                           1.21e-06
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bolivia                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina           1.42e-15
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Botswana                         3.20e-08
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brazil                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brunei                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bulgaria                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                     0.000107
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burundi                          1.06e-15
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cambodia                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cameroon                         0.025922
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Canada                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cape Verde                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Central African Republic          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chad                             0.070040
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chile                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)China                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Colombia                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Comoros                          8.89e-06
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Congo                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Costa Rica                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                     < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Croatia                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cuba                              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cyprus                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Czech Republic                    < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo 1.92e-08
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Denmark                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Djibouti                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominica                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominican Republic                < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ecuador                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Egypt                            1.05e-08
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)El Salvador                      0.021551
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                 < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Eritrea                          6.46e-09
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Estonia                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ethiopia                         1.17e-12
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia    < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Fiji                              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Finland                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)France                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Gabon                            5.17e-15
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Georgia                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Germany                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ghana                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greece                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greenland                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Grenada                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guam                              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guatemala                        0.571262
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea                           1.01e-14
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                    7.57e-08
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guyana                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Haiti                            0.045440
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Honduras                         4.17e-07
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Hungary                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iceland                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)India                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Indonesia                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iran                             0.104197
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iraq                              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ireland                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Israel                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Italy                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jamaica                          0.424716
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Japan                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jordan                           4.96e-06
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kenya                            1.54e-05
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kiribati                         3.19e-08
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kuwait                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Laos                              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Latvia                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lebanon                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lesotho                          0.000754
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Liberia                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Libya                            1.67e-05
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lithuania                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Luxembourg                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Macedonia                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Madagascar                       0.724371
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malawi                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malaysia                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Maldives                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mali                              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malta                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                  < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritania                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritius                        3.43e-05
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mexico                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Moldova                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mongolia                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Montenegro                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Morocco                          0.028918
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mozambique                       3.36e-09
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Myanmar                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Namibia                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nepal                            0.870489
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Netherlands                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)New Zealand                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nicaragua                        3.21e-05
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Niger                            4.76e-15
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nigeria                          7.07e-12
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)North Korea                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Norway                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Oman                              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Pakistan                         0.504747
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Palestine                        0.996377
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Panama                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                 4.74e-13
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Paraguay                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Peru                             0.270293
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Philippines                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Poland                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Portugal                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Qatar                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Romania                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Russian Federation                < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Rwanda                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines  < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Samoa                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe            0.077246
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                     0.032721
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Senegal                          0.005526
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Serbia                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Seychelles                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                      < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Singapore                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovakia                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovenia                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                  0.712979
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Somalia                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Africa                      < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Korea                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Sudan                      0.502392
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Spain                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sudan                            0.058278
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Suriname                         9.68e-15
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Swaziland                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sweden                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Switzerland                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Syria                            0.920087
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Taiwan                            < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tajikistan                       0.473518
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tanzania                         2.00e-07
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Thailand                          < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Bahamas                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Gambia                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                       < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Togo                              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tonga                             < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago              6.35e-13
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tunisia                          0.770207
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkey                           0.010180
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                      < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uganda                           0.549574
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ukraine                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Kingdom                    < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United States                     < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uruguay                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                        < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vanuatu                          1.00e-15
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Venezuela                         < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vietnam                           < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.              < 2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Yemen                            2.06e-07
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zambia                           1.54e-05
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                         0.059728
                                                                                                                
(Intercept)                                                                                                  ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)30 to 34                           
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)35 to 39                           
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)40 to 44                        *  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)45 to 49                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)50 to 54                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)55 to 59                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)60 to 64                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)65 to 69                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)70 to 74                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)75 to 79                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)80 to 84                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)85 to 89                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)90 to 94                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)95 plus                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Albania                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Algeria                          *  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)American Samoa                   ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Andorra                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Angola                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Antigua and Barbuda              ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Argentina                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Armenia                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Australia                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Austria                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Azerbaijan                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bahrain                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bangladesh                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Barbados                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belarus                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belgium                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Belize                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Benin                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bermuda                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bhutan                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bolivia                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bosnia and Herzegovina           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Botswana                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brazil                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Brunei                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Bulgaria                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burkina Faso                     ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Burundi                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cambodia                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cameroon                         *  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Canada                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cape Verde                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Central African Republic         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chad                             .  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Chile                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)China                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Colombia                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Comoros                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Congo                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Costa Rica                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cote d'Ivoire                    ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Croatia                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cuba                             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Cyprus                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Czech Republic                   ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Democratic Republic of the Congo ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Denmark                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Djibouti                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominica                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Dominican Republic               ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ecuador                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Egypt                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)El Salvador                      *  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Equatorial Guinea                ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Eritrea                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Estonia                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ethiopia                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Federated States of Micronesia   ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Fiji                             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Finland                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)France                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Gabon                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Georgia                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Germany                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ghana                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greece                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Greenland                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Grenada                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guam                             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guatemala                           
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guinea-Bissau                    ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Guyana                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Haiti                            *  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Honduras                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Hungary                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iceland                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)India                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Indonesia                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iran                                
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Iraq                             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ireland                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Israel                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Italy                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jamaica                             
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Japan                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Jordan                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kazakhstan                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kenya                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kiribati                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kuwait                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Kyrgyzstan                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Laos                             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Latvia                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lebanon                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lesotho                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Liberia                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Libya                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Lithuania                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Luxembourg                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Macedonia                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Madagascar                          
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malawi                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malaysia                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Maldives                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mali                             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Malta                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Marshall Islands                 ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritania                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mauritius                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mexico                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Moldova                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mongolia                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Montenegro                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Morocco                          *  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Mozambique                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Myanmar                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Namibia                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nepal                               
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Netherlands                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)New Zealand                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nicaragua                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Niger                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Nigeria                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)North Korea                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Northern Mariana Islands         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Norway                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Oman                             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Pakistan                            
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Palestine                           
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Panama                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Papua New Guinea                 ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Paraguay                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Peru                                
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Philippines                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Poland                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Portugal                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Puerto Rico                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Qatar                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Romania                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Russian Federation               ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Rwanda                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Lucia                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saint Vincent and the Grenadines ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Samoa                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sao Tome and Principe            .  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Saudi Arabia                     *  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Senegal                          ** 
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Serbia                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Seychelles                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sierra Leone                     ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Singapore                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovakia                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Slovenia                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Solomon Islands                     
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Somalia                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Africa                     ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Korea                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)South Sudan                         
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Spain                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sri Lanka                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sudan                            .  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Suriname                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Swaziland                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Sweden                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Switzerland                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Syria                               
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Taiwan                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tajikistan                          
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tanzania                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Thailand                         ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Bahamas                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)The Gambia                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Timor-Leste                      ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Togo                             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tonga                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Trinidad and Tobago              ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Tunisia                             
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkey                           *  
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Turkmenistan                     ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uganda                              
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Ukraine                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Arab Emirates             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United Kingdom                   ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)United States                    ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uruguay                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Uzbekistan                       ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vanuatu                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Venezuela                        ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Vietnam                          ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Virgin Islands, U.S.             ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Yemen                            ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zambia                           ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)Zimbabwe                         .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.09512 on 5641 degrees of freedom
Multiple R-squared:  0.9444,    Adjusted R-squared:  0.9424 
F-statistic: 460.9 on 208 and 5641 DF,  p-value: < 2.2e-16

We could instead perform a similar analysis as we did for the two group analysis where we controlled for the paired data structure using a random effect based on location. This is how we would could account for this data structure within the aov() function using Error() and again using the lmer() function with 1|variable_name.


Error: pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)
           Df Sum Sq Mean Sq F value Pr(>F)
Residuals 194  819.7   4.225               

Error: Within
                                                                                Df
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   14
Residuals                                                                     5641
                                                                              Sum Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)  47.64
Residuals                                                                      51.04
                                                                              Mean Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   3.403
Residuals                                                                       0.009
                                                                              F value
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   376.1
Residuals                                                                            
                                                                              Pr(>F)
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) <2e-16
Residuals                                                                           
                                                                                 
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) ***
Residuals                                                                        
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Type III Analysis of Variance Table with Satterthwaite's method
                                                                              Sum Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) 47.641
                                                                              Mean Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)  3.4029
                                                                              NumDF
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)    14
                                                                              DenDF
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)  5641
                                                                              F value
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)  376.12
                                                                                 Pr(>F)
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) < 2.2e-16
                                                                                 
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Notice now the results only show for the age_group_name, but they are the same as in the analysis with the fixed effect for location_name.

Modeling all of our groups of interest

Now that we know that linear regressions allow us to perform group comparisons like \(t\)-tests and anovas, but can also provide is with additional information, we can extend our analysis a bit further. We could include sex, location_name, and age_group_name in the same linear model and get information about how each of these factors influences dietary consumption, while accounting for the other factors.

Analysis of Variance Table

Response: log10(pull(filter(all_age_diet_and_guidelines, food == "red meat"), 
Response:     mean))
                                                                                Df
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   14
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)   194
pull(filter(all_age_diet_and_guidelines, food == "red meat"), sex)               1
Residuals                                                                     5640
                                                                              Sum Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)  47.64
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)  819.66
pull(filter(all_age_diet_and_guidelines, food == "red meat"), sex)             46.66
Residuals                                                                       4.37
                                                                              Mean Sq
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)   3.403
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)    4.225
pull(filter(all_age_diet_and_guidelines, food == "red meat"), sex)             46.663
Residuals                                                                       0.001
                                                                              F value
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name)  4388.0
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)   5448.1
pull(filter(all_age_diet_and_guidelines, food == "red meat"), sex)            60171.4
Residuals                                                                            
                                                                                 Pr(>F)
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) < 2.2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)  < 2.2e-16
pull(filter(all_age_diet_and_guidelines, food == "red meat"), sex)            < 2.2e-16
Residuals                                                                              
                                                                                 
pull(filter(all_age_diet_and_guidelines, food == "red meat"), age_group_name) ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), location_name)  ***
pull(filter(all_age_diet_and_guidelines, food == "red meat"), sex)            ***
Residuals                                                                        
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

We can see that sex, location, and age group all influence consumption of red meat.

Data Visualization

Now that we have statisitcally analyzed the consumption of red meat based on the location, sex, and age group of different populations around the world. Let’s make some visualizations to help with our interpretations.

Let’s try to make a plot that shows the relationship of age group, sex, and location on consumption of red meat.

First we will filter our data for only the data associated with red meat, and then we will create a boxplot graph with age group as the x axis, but include box plots for each sex for each age group. We can include an additional subplot to just look at the relationship of sex and consumption.

Ok, this is pretty good, but we can do better.

Let’s try specifically looking at the countries that overconsumed red meat. We can look at these countries by filtering our data where mean_percent was greater than 100%. Now we will overlap the jitter points and the boxplot using the position_jitterdoge() as the position in geom_pont(). In order to not obscure our boxplots, we can use the argument alpha to make our jitter points more transparent.

What are the countries that have such high consumption rates?

# A tibble: 8 x 20
  year_id location_name food  age_group_id age_group_name sex   parameter
    <dbl> <chr>         <chr>        <dbl> <chr>          <chr> <chr>    
1    2017 Laos          red …           10 25 to 29       Male  continuo…
2    2017 Laos          red …           11 30 to 34       Male  continuo…
3    2017 Laos          red …           12 35 to 39       Male  continuo…
4    2017 Laos          red …           13 40 to 44       Male  continuo…
5    2017 Timor-Leste   red …           10 25 to 29       Male  continuo…
6    2017 Timor-Leste   red …           11 30 to 34       Male  continuo…
7    2017 Timor-Leste   red …           12 35 to 39       Male  continuo…
8    2017 Timor-Leste   red …           13 40 to 44       Male  continuo…
# … with 13 more variables: mean <dbl>, upper <dbl>, lower <dbl>,
#   unit <chr>, direction <chr>, lower_optimal <dbl>, optimal <dbl>,
#   upper_optimal <dbl>, unit_optimal <chr>, mean_percent <dbl>,
#   range_percent <dbl>, percent_over_under <dbl>, opt_achieved <chr>

Looks like the males in Laos and Timor_Leste have the highest consumption.

Now let’s plot just the populations that eat less than the optimal amount by filtering for mean_percent < 100%.

Nice! It would be nice to be able to know what countries the datapoints correspond to. One way to do this is using a package called ggiraph. This package is really helpful for creating interactive graphs. We will use the geom_point_interactive() function to allow us to hover over points to display the country name. We indicate what label we want with the tooltip argument. This function is similar to the normal geom_point() function. Thus, we will include the same arguments as before. However, we will also split the male and female data using facet_wrap() to make things a bit less overwhelming.

Notice that we are creating a plot object before we use the geom_point_interactive().

We are also rendering the plot with the girafe() function of the ggiraph package.

List of 1
 $ axis.text.x:List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : num 1
  ..$ vjust        : NULL
  ..$ angle        : num 70
  ..$ lineheight   : NULL
  ..$ margin       : NULL
  ..$ debug        : NULL
  ..$ inherit.blank: logi FALSE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 - attr(*, "class")= chr [1:2] "theme" "gg"
 - attr(*, "complete")= logi FALSE
 - attr(*, "validate")= logi TRUE

Cool!

From this plot we can see the countries with populations that do well by not overconsuming red meat, (as overconsumtion is associated with health risk). We see that different countries greatly vary, we can see that overall younger populations appear to consume more red meat, and men appear to consume red meat.

Let’s do the same thing for the overconsuming countries. We can also take this one step further to show all the points for the same country when we hover over one data point by using the data_id argument of the geom_point_interactive() function. We can also add links to wikipedia pages for these countries using the onclick argument.

List of 1
 $ axis.text.x:List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : num 1
  ..$ vjust        : NULL
  ..$ angle        : num 70
  ..$ lineheight   : NULL
  ..$ margin       : NULL
  ..$ debug        : NULL
  ..$ inherit.blank: logi FALSE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 - attr(*, "class")= chr [1:2] "theme" "gg"
 - attr(*, "complete")= logi FALSE
 - attr(*, "validate")= logi TRUE

                state Murder Assault UrbanPop Rape
Alabama       alabama   13.2     236       58 21.2
Alaska         alaska   10.0     263       48 44.5
Arizona       arizona    8.1     294       80 31.0
Arkansas     arkansas    8.8     190       50 19.5
California california    9.0     276       91 40.6
Colorado     colorado    7.9     204       78 38.7
Observations: 87,750
Variables: 21
$ year_id            <dbl> 2017, 2017, 2017, 2017, 2017, 2017, 2017, 201…
$ location_name      <chr> "China", "China", "China", "China", "China", …
$ food               <chr> "fruits", "fruits", "fruits", "fruits", "frui…
$ age_group_id       <dbl> 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 3…
$ age_group_name     <chr> "25 to 29", "30 to 34", "35 to 39", "40 to 44…
$ sex                <chr> "Male", "Male", "Male", "Male", "Male", "Male…
$ parameter          <chr> "continuous", "continuous", "continuous", "co…
$ mean               <dbl> 200.71025, 169.95312, 147.29606, 130.10882, 1…
$ upper              <dbl> 162.27375, 132.28750, 123.47975, 107.39825, 1…
$ lower              <dbl> 240.35075, 208.05500, 174.66575, 155.63850, 1…
$ unit               <chr> "g/day", "g/day", "g/day", "g/day", "g/day", …
$ direction          <chr> "low", "low", "low", "low", "low", "low", "lo…
$ lower_optimal      <dbl> 200, 200, 200, 200, 200, 200, 200, 200, 200, …
$ optimal            <dbl> 250, 250, 250, 250, 250, 250, 250, 250, 250, …
$ upper_optimal      <dbl> 300, 300, 300, 300, 300, 300, 300, 300, 300, …
$ unit_optimal       <chr> "g", "g", "g", "g", "g", "g", "g", "g", "g", …
$ mean_percent       <dbl> 80.28410, 67.98125, 58.91842, 52.04353, 47.35…
$ range_percent      <dbl> 100.35513, 84.97656, 73.64803, 65.05441, 59.1…
$ percent_over_under <dbl> 0.00000, 15.02344, 26.35197, 34.94559, 40.804…
$ opt_achieved       <chr> "Yes", "No", "No", "No", "No", "No", "No", "N…
$ link               <chr> "window.open(\"http://en.wikipedia.org/wiki/C…
# simplified national means plot
Means_plot<-BMI_long %>% 
  filter(Sex %in% c("Men", "Women"), 
         Year %in% c("1985", "2017"), 
         Region == "National") %>%
ggplot(aes(x = Sex, y = BMI)) + 
  geom_boxplot(outlier.shape = NA, color = "black" , aes(fill = Sex)) + 
 scale_fill_manual(values=c("dodgerblue", "orchid2")) +
  facet_grid(~ Year) + 
  geom_hline(yintercept=30, linetype="dashed", color = "red", size =1) + 
  geom_jitter(data=BMI_long %>%
                filter(Sex %in% c("Men", "Women"), 
                       Year %in% c("1985", "2017"), 
                       Region == "National"),
                aes(x =Sex, y =BMI), 
                width = .2, size =2, shape =21, 
                color = "black", fill = "gray") +
  geom_jitter(data=subset(BMI_long %>%
                            filter(Sex %in% c("Men", "Women"), 
                                   Year %in% c("1985", "2017"), 
                                   Region == "National", 
                                   Country == "USA")), 
                             aes(x =Sex, y =BMI), 
                             width = .02, size =12, shape =21, 
                             color = "black", fill = "gray") + 
  # This will add points that are larger for the USA data
  geom_text(data=subset(BMI_long%>%
                          filter(Sex %in% c("Men", "Women"), 
                                 Year %in% c("1985", "2017"), 
                                 Region == "National", Country == "USA")),
                          aes(x =Sex, y =BMI,label=Country), 
                          color = "black") + 
  # This will add USA labels to the USA points
  theme_linedraw() +
  # This will make thebackground of the plot white and the facet labels black
  theme(legend.position = "none", 
  # This is useful for removing the legend
        axis.text.x = element_text(size = 15,angle = 30, vjust = 0.5), 
        # this changes the size and angle of the x axis point labels 
        axis.text.y = element_text(size = 20), 
        axis.title.y = element_text(size =15), 
        axis.title.x = element_text(size =15), 
        strip.text.x = element_text(size = 15))
   
#Simplified difference plot 
BMI_diff_long$Type <-BMI_diff_long$Type %>%
  str_replace( pattern = "_difference", replacement = "")

Diff_plot<-BMI_diff_long %>% 
  filter(Sex %in% c("Men", "Women"), 
         Type != "National") %>%
ggplot( aes(x = Type, y = Difference, col = Type)) + 
  geom_boxplot(outlier.shape = NA, color = "black" , aes(fill = Sex)) + 
  scale_fill_manual(values=c("dodgerblue", "orchid2")) +
  facet_grid(~ Sex) +
  geom_jitter(data=BMI_diff_long %>% 
    filter(Sex %in% c("Men", "Women"), 
           Type != "National"), 
    aes(x =Type, y =Difference), 
    width = .2, size =2, shape =21, 
    color = "black", fill = "gray") + 
  geom_jitter(data=subset(BMI_diff_long %>% 
    filter(Sex %in% c("Men", "Women"), 
           Type != "National", 
           Country == "USA")), 
    aes(x =Type, y =Difference), 
    width = .02, size =12, shape =21, 
    color = "black", fill = "gray") + 
  # This will add points that are larger for the USA data
  geom_text(data=subset(BMI_diff_long %>% 
    filter(Sex %in% c("Men", "Women"),
           Type != "National"), 
           Country == "USA"),
    aes(x =Type, y =Difference,label=Country), 
    color = "black") + 
  # This will add USA labels to the USA points
  theme_linedraw() +
    # This will make the background of the plot white and the facet labels black
  theme(legend.position = "none", 
  # This is useful for removing the legend
        axis.text.x = element_text(size = 15,angle = 30, vjust = 0.5), 
        # this changes the size and angle of the x axis point labels 
        axis.text.y = element_text(size = 20), 
        axis.title.y = element_text(size =15), 
        axis.title.x = element_text(size =15), 
        strip.text.x = element_text(size = 15))
  # this changes the size of x axis labels for the facet

#add labels
Diff_plot<-Diff_plot + 
        labs(title = "Change in BMI by region", 
             x = "", 
             y = "Change in BMI \n (1985 to 2017)") +
        theme(title = element_text (size = 12, face = "bold"))

Means_plot <-Means_plot + 
        labs(title = "Mean BMI over time", 
             x = "", 
             y = "Mean BMI") +
        theme(title = element_text (size = 12, face = "bold"))



obesity_text<-tibble(Year=c(1985),BMI=c(31),Sex=c("Men"),label=c("Obesity"))

Means_plot <-Means_plot + 
             geom_text(data = obesity_text,
                       label=pull(obesity_text,label), 
                       color = "red", 
                       aes( fontface ="bold.italic", size = 13))

cowplot::plot_grid(Means_plot, Diff_plot, labels = c("A", "B"))

Summary

Next, we want to propose our idea for a second case study in the same focus area of:

  • Question: How do diets (consumption of various major foods and nutrients) differ by regions (e.g. low-income countries vs not) and by gender around the world? What is the impact of the different diets on mortality or life expectancy?
  • Description: We would take some of the main results from this paper (https://www.thelancet.com/journals/lancet/article/PIIS0140-6736(19)30041-8/fulltext){target="_blank"} and highlight them in a case study (similar to before not trying to reproduce the analysis). This paper shows the leading dietary risk factors for mortality included high intake of sodium, low intake of whole grains, and low intake of fruits.
  • Why is this important? This analysis demonstrates the need to improve diet across nations and inform implementation of evidence-based dietary interventions.
  • Data: This the link Jess Fanzo sent us (https://vizhub.healthdata.org/gbd-compare/){target="_blank"}, but we had to track down a specific set of files that were not included in the link to be able to do this analysis. These files were sent to us in a CSV format and we have been given permission to host them as part of our case study and just cite the original study.
  • Major Data Science Objectives:
  1. scraping data (gapminder) # probably not anymore
  2. loading data from data package
  3. wrangling - joining dplyr
  4. visualization - ggplot
  • Statistics objectives: We are currently torn between demonstrating linear regression or factor analysis. Once we start the case study, it will be easier for us to understand. We’ll keep you posted on that. # to get a ratio of veggie consumption: Veggies$mean/250 *100 #https://www.guru99.com/r-anova-tutorial.html

To do this we need to check if our data violates the assumptions that these statistical test rely on in order to choose the appropriate test to compare groups.

LS0tCnRpdGxlOiAiT3BlbiBDYXNlIFN0dWRpZXMgOiBFeHBsb3JpbmcgZ2xvYmFsIHBhdHRlcm5zIG9mIGRpZXRhcnkgYmVoYXZpb3JzIGFzc29jaWF0ZWQgd2l0aCBoZWFsdGggcmlzayAiCmNzczogc3R5bGUuY3NzCm91dHB1dDoKICBodG1sX2RvY3VtZW50OgogICAgc2VsZl9jb250YWluZWQ6IHllcwogICAgY29kZV9kb3dubG9hZDogeWVzCiAgICBoaWdobGlnaHQ6IHRhbmdvCiAgICBudW1iZXJfc2VjdGlvbnM6IG5vCiAgICB0aGVtZTogY29zbW8KICAgIHRvYzogeWVzCiAgICB0b2NfZmxvYXQ6IHllcwogIHBkZl9kb2N1bWVudDoKICAgIHRvYzogeWVzCiAgd29yZF9kb2N1bWVudDoKICAgIHRvYzogeWVzCi0tLQoKCgpgYGB7ciBzZXR1cCwgaW5jbHVkZT1GQUxTRX0Ka25pdHI6Om9wdHNfY2h1bmskc2V0KGluY2x1ZGUgPSBUUlVFLCBjb21tZW50ID0gTkEsIGVjaG8gPSBUUlVFLAogICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA9IEZBTFNFLCB3YXJuaW5nID0gRkFMU0UsIGNhY2hlID0gRkFMU0UsCiAgICAgICAgICAgICAgICAgICAgICBmaWcuYWxpZ24gPSAiY2VudGVyIiwgb3V0LndpZHRoID0gJzkwJScpCmxpYnJhcnkoaGVyZSkKbGlicmFyeShrbml0cikKYGBgCgoKCmBgYHtyLCBlY2hvID0gRkFMU0UsIGV2YWwgPSBGQUxTRX0Ka25pdHI6OmluY2x1ZGVfZ3JhcGhpY3MoaGVyZTo6aGVyZ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AgICAgICAgZm9vZCA9PSAiZnJ1aXRzIiksIAogICAgICAgICAgICAgIG1lYW5fcGVyY2VudCksCiAgICAgICAgICBwdWxsKGZpbHRlcihkaWV0X2FuZF9ndWlkZWxpbmVzLAogICAgICAgICAgICAgIGZvb2QgPT0gImZydWl0cyIpLCAKICAgICAgICAgICAgICBzZXgpKQoKdmFyLnRlc3QobG9nMTAocHVsbChmaWx0ZXIoZGlldF9hbmRfZ3VpZGVsaW5lcywKICAgICAgICAgICAgICAgZm9vZCA9PSAiZnJ1aXRzIiksIAogICAgICAgICAgICAgICBtZWFuX3BlcmNlbnQpKX4KICAgICAgICAgcHVsbChmaWx0ZXIoZGlldF9hbmRfZ3VpZGVsaW5lcywKICAgICAgICAgICAgICAgZm9vZCA9PSAiZnJ1aXRzIiksIAogICAgICAgICAgICAgICBzZXgpKQoKc3VtbWFyeShsbWVyKAogIGxvZzEwKHB1bGwoZmlsdGVyKGRpZXRfYW5kX2d1aWRlbGluZXMsIAogICAgICAgICAgICAgICAgICBmb29kID09ICJmcnVpdHMiKSwKICAgICAgICAgICAgICAgICAgbWVhbl9wZXJjZW50KSkgfiAKICAgICAgICBwdWxsKGZpbHRlcihkaWV0X2FuZF9ndWlkZWxpbmVzLCAKICAgICAgICAgICAgICAgICAgZm9vZCA9PSAiZnJ1aXRzIiksCiAgICAgICAgICAgICAgICAgIHNleCkrIAogICAgKDEgfCBwdWxsKGZpbHRlcihkaWV0X2FuZF9ndWlkZWxpbmVzLCAKICAgICAgICAgICAgICAgICAgZm9vZCA9PSAiZnJ1aXRzIiksIAogICAgICAgICAgICAgICAgICBsb2NhdGlvbl9uYW1lKSkpKQoKdC50ZXN0KGxvZzEwKHB1bGwoZmlsdGVyKHdpZGVfZGlldCwgCiAgICAgICAgICAgICAgICAgIGZvb2QgPT0gImZydWl0cyIpLAogICAgICAgICAgICAgICAgICBtZWFuX3BlcmNlbnRfRmVtYWxlKSksIAogICAgICAgbG9nMTAocHVsbChmaWx0ZXIod2lkZ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A9IC4yLCBzaXplID0yLCBzaGFwZSA9MjEsIAogICAgICAgICAgICAgICAgY29sb3IgPSAiYmxhY2siLCBmaWxsID0gImdyYXkiKSArCiAgZ2VvbV9qaXR0ZXIoZGF0YT1zdWJzZXQoQk1JX2xvbmcgJT4lCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWx0ZXIoU2V4ICVpbiUgYygiTWVuIiwgIldvbWVuIiksIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFllYXIgJWluJSBjKCIxOTg1IiwgIjIwMTciKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVnaW9uID09ICJOYXRpb25hbCIsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvdW50cnkgPT0gIlVTQSIpKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWVzKHggPVNleCwgeSA9Qk1JKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSAuMDIsIHNpemUgPTEyLCBzaGFwZSA9MjEsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yID0gImJsYWNrIiwgZmlsbCA9ICJncmF5IikgKyAKICAjIFRoaXMgd2lsbCBhZGQgcG9pbnRzIHRoYXQgYXJlIGxhcmdlciBmb3IgdGhlIFVTQSBkYXRhCiAgZ2VvbV90ZXh0KGRhdGE9c3Vic2V0KEJNSV9sb25nJT4lCiAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyKFNleCAlaW4lIGMoIk1lbiIsICJXb21lbiIpLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWWVhciAlaW4lIGMoIjE5ODUiLCAiMjAxNyIpLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVnaW9uID09ICJOYXRpb25hbCIsIENvdW50cnkgPT0gIlVTQSIpKSwKICAgICAgICAgICAgICAgICAgICAgICAgICBhZXMoeCA9U2V4LCB5ID1CTUksbGFiZ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